Trying to make a simple voting/poll system.
Hi everyone. I am trying to make a very basic voting system and the only part i am having trouble with is the results. The DB table has QuestionID and VoteResult. In the VoteResults you can enter the word "Excellent", "Good", "Bad". I would like it to show the result of all the "excellent" vote and add a recordcount next to it showing how many people voted Excellent and how many selected good...and so on.I also tried showing the results with cfchart, but i have a very limited knowledge or the cfchart and just couldn't get it to work....so ya.
For example:
Excellent 20 votes
Good 5 votes
Bad 75 votes
Hope this makes sense.
Thanks
Here is my code
===== Code =====
<cfparam name="URL.Question" default="1" />
<cfquery name="qResults" datasource="poll">
SELECT QuestionID,COUNT(VoteResults) AS Votes
FROM PollSystem
WHERE QuestionID = <cfqueryparam value="#URL.Question#" cfsqltype="cf_sql_numeric">
GROUP BY QuestionID
</cfquery>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<cfchart format="flash"
scalefrom="0"
scaleto="100">
<cfchartseries type="bar"
query="qResults">
<cfchartdata item="Excellent" value="#qResults.Votes#">
<cfchartdata item="Good" value="#qResults.Votes#">
<cfchartdata item="Bad" value="#qResults.Votes#">
</cfchartseries>
</cfchart>
</body>
</html>
===== End code =========
It's showing me 4 bars, 3 are named according to the code, but there's an extra one with no name and i don't know where it came from. Plus it's show the entire vote results, for example questionid 1 has 9 votes in total. it's counting the excellent, good and bad votes together.
Again the database table only consists of QuestionID and VoteResults. that's it.
Similar Messages
-
im trying to make a simple 360 rotation for a 3d logo in CC 2014 but when i tried to create the 1st key frame the image when out axis
I find that if you have multiple 3d object they must be merged into a single 3d layer their positions reset to align to the same axises then sized and positioned along them. The layer should then be able to be animated well around an axis like the y axis. Here a Sphere, Cylinder and ring. http://www.mouseprints.net/old/dpr/McAssey-CC.mp4
-
Help : Lost in Code - Trying to make a simple Click-Through
Hey Everyone -
I've come in search of some help and expertise. I've found a
website which I would like to copy in functionality - in hopes of
creating a simple slideshow of images. They are using the MOOTOOLS
framework for the Slide animation - i've gotten that to work
- but i can't figure out how to replicate the clickthrough-
SO - what i'm trying to do is copy this page exactly -
http://www.thegraphicgraphic.com/
you'll see that it's just three lines of text ( rollovers )
and the last line opens up a javascript slider window - now i've
managed to copy most of it by taking the code and figuring out the
urls for the javascript and such .
check out my version here :
http://www.nontype.com/beograd.html
i've got the css and java stuff working okay - but what i
can't seem to figure out at all is how they are getting the
rollover links to link to the NEXT IMAGE - they're using some tags
that i don't understand : it looks something like this : : :
<div id="header">
<ul>
<li>
<a href=""
onmouseover="this.innerHTML = 'NEXT'"
onmouseout="this.innerHTML = 'THE'">
THE</a>
</li>
<li>
<a href=""
onmouseover="this.innerHTML = 'PREVIOUS'"
onmouseout="this.innerHTML = 'GRAPHIC'">
GRAPHIC</a>
</li>
<li>
<a href="#" id="button" onmouseover="this.innerHTML =
'INFORMATION'"
onmouseout="this.innerHTML = 'GRAPHIC'">
GRAPHIC</a>
</li>
</ul>
</div>
AND The JAVASCRIPT Used for both the sliders ( and I assume
the click-through functionality ) is :
window.addEvent('domready', function() {
var Slider = new Fx.Slide('about',{mode: 'horizontal',
duration: 100}).hide();
$('button').addEvent('click', function() {
Slider.toggle('horizontal');
function noSpam(user,domain) {
locationstring = "mailto:" + user + "@" + domain;
window.location = locationstring;
function MM_openBrWindow(theURL,winName,features) { //v2.0
window.open(theURL,winName,features);
I just want to click NEXT to progress to the next background
image / and PREVIOUS for the prev. image . . . . . . . . Could
anyone here tell me how to do this as in the first site ? ? ? Would
I be able to simply create multiple HTML Pages - use an Embed tag -
and then link the PREV and NEXT buttons with tags ?
I'm just trying to make this work by any means but am finding
the code impossible to crack -
I tried asking this question in the mootools forum but was
told to look elsewhere - I'm more than willing to use
any other means in order to make this work .
MANY THANKS IN ADVANCE FOR YOU HELP . . .Have you asked the authors?
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.dreamweavermx-templates.com
- Template Triage!
http://www.projectseven.com/go
- DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs,
Tutorials & Resources
http://www.macromedia.com/support/search/
- Macromedia (MM) Technotes
==================
"aerolex" <[email protected]> wrote in
message
news:f2naeu$q66$[email protected]..
> Hello - would anyone have any advice - or should i
somehow reword the
> question ?
>
> or could some provide some insight as to where i might
look to resolve
> this question ?
>
> THANKS AGAIN -
CS4 - Trying to make a simple walking animation symbol
I've searched everywhere online, and can't find the help for this!
I've found some videos, but they did not seem to offer any sort of help for me.
I still cannot for the life of me figure out how to take 3 images, and make them into a simple walking animation and to convert that to one symbol.
Can anyone offer their help to me please so I can get my project going?
I'm using CS4, and all articles I can find are of the older versions of flash.I managed to figure out how to do it, and yes it was as you stated. I was trying to use motion before to make my images animate together, and now I realized that that is not how to do it.
-
Trying to make a simple background color change.
I double clicked the foreground/background black and white squares as usual. This brought up the color selector and I changed to the color I wanted. When I clicked ok the foreground color changed to a medium gray instead of the color I had selected?
Are you in Greyscale mode by any chance? Image > Mode > Select RGB.
-
How to make a simple animation within text area ?
Hi guys ,I am getting familiar with the Flash animations so I would appreciate a bit of help.
I am trying to make a simple animation within the text input area i.e.
1.FAN BASE
2.FA NBASE
What I want is the letter N to move slowly towards letter B.I have done motion tweening but it doesn't work - either the whole text is moving left right or the letter N is simply skipping to the second position without smooth animation.( there's no error on motion tween by the way) any ideas ?
Thanks.best would be you would create your sentence "fanbase" and break down the single letters into objects by selecting the whole textfield and pressing CTRL+B, convert everyone of them into single movieclips or graphics and tween them accordingly.
-
How to make a simple form layout without ad RAD tool
I'm trying to make a simple form, but I'm not finding the right layout manager to make the components goes in Y axis. The BoxLayout could solve my problem, if it does not fill all the panel with the components.
My SCCEE:
public class TestSimpleForm extends JPanel {
JLabel nameLbl = new JLabel("Name:");
JTextField nameField = new JTextField();
JButton okBtn = new JButton("OK");
JButton cancelBtn = new JButton("Cancel");
public TestSimpleForm() {
add(nameLbl);
add(nameField);
add(okBtn);
add(cancelBtn);
public static void main(String[] args) {
JPanel panel = new TestSimpleForm();
// if i make it a boxlayout panel, the text field size goes huge
// panel.setLayout(new BoxLayout(panel, BoxLayout.Y_AXIS));
JFrame f = new JFrame();
f.setContentPane(panel);
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
f.setSize(400, 600);
f.setLocationRelativeTo(null);
f.setVisible(true);
}wellington7 wrote:
..My SCCEE:While I don't know what an SCCEE is, I am very familiar with the SSCCE, and..
public class TestSimpleForm extends JPanel {
.....this code is surely not an SSCCE.
Running tool: Java Compile
/media/disk/projects/numbered/all/TestSimpleForm.java:1: cannot find symbol
symbol: class JPanel
public class TestSimpleForm extends JPanel {
^
/media/disk/projects/numbered/all/TestSimpleForm.java:3: cannot find symbol
symbol : class JLabel
location: class TestSimpleForm
JLabel nameLbl = new JLabel("Name:");
^
/media/disk/projects/numbered/all/TestSimpleForm.java:4: cannot find symbol
symbol : class JTextField
location: class TestSimpleForm
JTextField nameField = new JTextField();
^
/media/disk/projects/numbered/all/TestSimpleForm.java:6: cannot find symbol
symbol : class JButton
location: class TestSimpleForm
JButton okBtn = new JButton("OK");
^
/media/disk/projects/numbered/all/TestSimpleForm.java:7: cannot find symbol
symbol : class JButton
location: class TestSimpleForm
JButton cancelBtn = new JButton("Cancel");
^
/media/disk/projects/numbered/all/TestSimpleForm.java:3: cannot find symbol
symbol : class JLabel
location: class TestSimpleForm
JLabel nameLbl = new JLabel("Name:");
^
/media/disk/projects/numbered/all/TestSimpleForm.java:4: cannot find symbol
symbol : class JTextField
location: class TestSimpleForm
JTextField nameField = new JTextField();
^
/media/disk/projects/numbered/all/TestSimpleForm.java:6: cannot find symbol
symbol : class JButton
location: class TestSimpleForm
JButton okBtn = new JButton("OK");
^
/media/disk/projects/numbered/all/TestSimpleForm.java:7: cannot find symbol
symbol : class JButton
location: class TestSimpleForm
JButton cancelBtn = new JButton("Cancel");
^
/media/disk/projects/numbered/all/TestSimpleForm.java:17: cannot find symbol
symbol : class JPanel
location: class TestSimpleForm
JPanel panel = new TestSimpleForm();
^
/media/disk/projects/numbered/all/TestSimpleForm.java:22: cannot find symbol
symbol : class JFrame
location: class TestSimpleForm
JFrame f = new JFrame();
^
/media/disk/projects/numbered/all/TestSimpleForm.java:22: cannot find symbol
symbol : class JFrame
location: class TestSimpleForm
JFrame f = new JFrame();
^
/media/disk/projects/numbered/all/TestSimpleForm.java:24: cannot find symbol
symbol : variable JFrame
location: class TestSimpleForm
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
^
13 errors
Exited: 256 -
Help me make a simple TextArea plz !!!
i'm trying to make a simple 2 text areas and a send button, that don't do anything right now i just want them there, i was trying this
import javax.swing.*;
import javax.swing.text.*;
import java.awt.*;
import java.awt.event.*;
import java.net.URL;
import java.io.IOException;
public class swing1 abstract extends JFrame
implements ActionListener {
private String newline = "\n";
protected static final String textFieldString = "JTextField";
protected static final String passwordFieldString = "JPasswordField";
protected JLabel actionLabel;
public swing1()
super("swing1");
//Create a regular text field.
JTextField textField = new JTextField(10);
textField.setActionCommand(textFieldString);
textField.addActionListener(this);
Frame frame = new Frame();
frame.setLayout(null);
frame.setBounds(100,100,150,70);
Button button1 = new Button("send");
frame.add(button1);
button1.setBounds(10,30,50,25);
frame.setVisible(true);
}any help would be great thanks, i'm atempting to make a password reconision thingy for a lesson at uni
thanks
Anti changed my code to this:-
import javax.swing.*;
import javax.swing.text.*;
import javax.swing.*;
import javax.swing.text.*;
import java.awt.*;
import java.awt.event.*;
import java.net.URL;
import java.io.IOException;
public class swing1 extends JFrame implements ActionListener
private String newline = "\n";
protected static final String textFieldString = "JTextField";
protected static final String passwordFieldString = "JPasswordField";
protected JLabel actionLabel;
private JTextField textField;
private JPasswordField passwordField;
private Container p; // make a panel to witch the components can be added
public swing1()
super("swing1");
//Create a regular text field.
textField = new JTextField(10);
textField.setActionCommand(textFieldString);
textField.addActionListener(this);
//Create a password field.
passwordField = new JPasswordField(10);
passwordField.setActionCommand(passwordFieldString);
passwordField.addActionListener(this);
//Create some labels for the fields.
JLabel textFieldLabel = new JLabel(textFieldString + ": ");
textFieldLabel.setLabelFor(textField);
JLabel passwordFieldLabel = new JLabel(passwordFieldString + ": ");
passwordFieldLabel.setLabelFor(passwordField);
//Create a label to put messages during an action event.
actionLabel = new JLabel("Type text and then Return in a field.");
actionLabel.setBorder(BorderFactory.createEmptyBorder(10,0,0,0));
//Lay out the text controls and the labels.
p=getContentPane(); //get te contant pane of this Swing1 to add the componets to
p.add("West",textField); //add your fist component, add it west on the dafault borderLayout
p.add("East",textFieldLabel);// add another component, add it east on the dafault borderLayout
p.add("South",passwordField);// add it south on the dafault borderLayout
p.add("North",actionLabel); // add it north on the dafault borderLayout
setSize(400,100); //make it a bit bigger
setVisible(true);
public void actionPerformed(ActionEvent e)
JFrame frame = new swing1();
frame.setDefaultCloseOperation( EXIT_ON_CLOSE );
new swing1(); //make a new instance of your class
[\code]
but now it will compile but not run, i think its because i don't have a main method, whereshould i put my main method ?
thanks
Ant -
I am trying to create a simple animated gif in Photoshop. I've set up my frames and want to use the tween to make the transitions less jerky. When I tween between frame 1 and frame 2 the object in frame two goes out of position, appearing in a different place than where it is on frame 2. Confused!
Hi Melissa - thanks for your interest. Here's the first frame, the second frame and the tween frame. I don't understand why the tween is changing the position of the object in frame 2, was expecting it to just fade from one frame to the next.
-
hi,all
I would like to make a simple poll in a page of an application,it only concludes two choices: yes and no.when i press the submit button I can see the percentage displayed as pie chart.how to do this ?any suggestions?Hi,
Step 1: Create Table structure and trigger for Sequence. I have not give code to create Sequence. That you can create with DEMO_POLL_SEQ name
CREATE TABLE "DEMO_POLL"
( "ID_PK" NUMBER,
"RESULT" NUMBER,
CONSTRAINT "DEMO_POLL_PK" PRIMARY KEY ("ID_PK") ENABLE
CREATE OR REPLACE TRIGGER "BI_DEMO_POLL"
before insert on "DEMO_POLL"
for each row
begin
if :NEW."ID_PK" is null then
select "DEMO_POLL_SEQ".nextval into :NEW."ID_PK" from dual;
end if;
end;
ALTER TRIGGER "BI_DEMO_POLL" ENABLE;
Step 2:
Create a new region on apex type Form with table and select "Result" column and make its type Radiogroup and create static lov
make sure after you create a region go to branch and put clear cache to the same page. so it clears the page item value.
Step 3:
Create another region with chart and paste following SQL query
SELECT NULL LINK,
REPLACE(REPLACE(RESULT,1,'YES'),0,'NO') LABEL,
COUNT(RESULT) VALUE
FROM DEMO_POLL
GROUP BY RESULT
ORDER BY RESULT
Hope this would workout for you.
And yes you can add me as in your friend list.
Thanks,
Jaydip Bosamiya,
+91 - 76000 23053
[http://jbosamiya.blogspot.com|http://jbosamiya.blogspot.com] -
Trying to make a iPhoto Library on my external hard drive but I get "the library could not be opened because the file system of the library's volume is unsupported." I reformatted my hard drive to ExFAT because I want to be able to use it on PC and MAC.
iOS: 10.10.1
Mac Book Air
External: WD 500 GB recently reformatted (no files on it currently)The iPhoto library must only be on a volume formatted Mac OS extended (journaled) - it can not be on any other format drive
LN -
Hi in need of help trying to add a live voting system
i am trying to add a live voting system to my website basically two buttons one dislike and like its quite hard to explain a good example is www.truelad.com they have the set up that i want and i am quite confused on how to do this.
any help would be mch appreciated
oyea and i want it to be live and login featureWhich server-side programming languages and databases are you using for your site?
There are several voting widgets (plug-ins) available for WordPress, Joomla! & Drupal. If you're using one of those frameworks to build your site, that's probably where you should begin searching.
Nancy O. -
How to make a Simple NIO Scalable Server?
I want to learn NIO for a project, but first want to start out simple. I want to figure out how to send a string across from clients to a server using NIO. I tried looking up stuff, but got caught in the terminology and such. How can I make a simple scalable server (agh tripple S) to send strings across? (like a chat server or something). All I know is I need to use a Selector and some Threaded loops to do stuff.
I found http://gee.cs.oswego.edu/dl/cpjslides/nio.pdf and tweaked the code to make (what I thought was) a simple server, but I do not know how to make client code or even whether or not my Server code works.
This is what I have so far:
import java.io.*;
import java.nio.*;
import java.nio.channels.*;
import java.nio.channels.spi.*;
import java.net.*;
import java.util.*;
import static java.lang.System.*;
public class NIOTest {
public static void main(String args[]) throws Throwable
try {
new Thread(new NIOTestServer()).start();
} catch(Exception e) {
e.printStackTrace();
class NIOTestServer implements Runnable
final Selector selector;
final ServerSocketChannel serverSocket;
int chatPort=9990;
public NIOTestServer() throws Exception
selector=Selector.open();
serverSocket = ServerSocketChannel.open();
serverSocket.socket().bind(
new InetSocketAddress(chatPort));
serverSocket.configureBlocking(false);
SelectionKey sk =
serverSocket.register(selector,
SelectionKey.OP_ACCEPT);
sk.attach(new Acceptor());
public void run()
try
while(!Thread.interrupted())
selector.select(); //Blocks until atleast one I/O event has occured
Iterator<SelectionKey> it=selector.selectedKeys().iterator();
while(it.hasNext())
dispatch(it.next());
catch(Throwable lol)
lol.printStackTrace();
void dispatch(SelectionKey k)
Runnable r = (Runnable)(k.attachment());
if (r != null)
r.run();
class Acceptor implements Runnable
{ // inner class to accept the event
public void run()
try
SocketChannel c = serverSocket.accept();
if (c != null)
new Handler(selector, c);
catch(IOException ex) {ex.printStackTrace();}
import java.io.*;
import java.nio.*;
import java.nio.channels.*;
import java.nio.channels.spi.*;
import java.net.*;
import java.util.*;
import static java.lang.System.*;
final class Handler implements Runnable {
final SocketChannel socket;
final SelectionKey sk;
ByteBuffer input = ByteBuffer.allocate(1024);
ByteBuffer output = ByteBuffer.allocate(1024);
static final byte READING = 0, SENDING = 1;
byte state = READING;
Handler(Selector sel, SocketChannel c) throws IOException
socket = c; c.configureBlocking(false); //makes it non blocking
// Optionally try first read now
sk = socket.register(sel, 0);
sk.attach(this);
sk.interestOps(SelectionKey.OP_READ);
sel.wakeup();
boolean inputIsComplete()
return input.hasRemaining();
boolean outputIsComplete()
return output.hasRemaining();
void process()
CharBuffer buf=input.asCharBuffer();
buf.flip();
out.println(buf);
public void run()
try {
if (state == READING) read();
else if (state == SENDING) send();
catch (IOException ex) { ex.printStackTrace(); }
void read() throws IOException
socket.read(input);
if (inputIsComplete())
process();
state = SENDING;
// Normally also do first write now
sk.interestOps(SelectionKey.OP_WRITE);
void send() throws IOException
socket.write(output);
if (outputIsComplete()) sk.cancel();
}again this is a rough incomplete code test.See http://forum.java.sun.com/thread.jspa?forumID=536&threadID=5277053. You can use Telnet as a test client. When you come to write your own client, use java.net, not java.nio.
-
Trying to make a DVD with an old/non-existent version of iDVD!
Ladies and Gentlemen,
Please could you help me?
I work at a school in the UK, and have recently been able to purchase an external Lacie DVD drive, as the school’s computer (currently an iBook G4 with OSX 10.3.2 and a 1GHZ Power PC Processor – 640 MB Memory and a 40 GB HD) wasn’t shipped with one – however, I have a problem…
Trying to make a DVD that will play in a stand-alone DVD player – I followed the advice in iMovie Help – but was stopped suddenly on finding that I do not have the relevant version of iDVD (which version (if any – I can’t see it anywhere!) was shipped with iMovie 4.0?). Is it possible to download a copy of iDVD 3 or later from anywhere compatible with OSX 10.3.2 and iMovie 4.0?
The iMovie Help has an additional option to ‘export your movie in a format appropriate for DVD authoring’ which has let me burn the movie as a (name).DV file – but this is not compatible with any DVD player I have tried. I noticed a while ago on this forum that someone was talking about Toast but I do not have this, but I do have Roxio Easy Media Creator 7, which was bundled with the burner – but is only compatible with a PC – would I be able to build a project in iMovie, transfer it to a PC, and use REMC7 to do what toast would?
Finally, I was wondering if anyone has any experience of using Avid’s free DV software – and if they would recommend it (and also if I would be able to make DVDs with it?).
Well thanks for reading if you got this far – and I’d appreciate it if you could offer any advice (I know I’ve not been very concise)…
Kevin.
iBook G4 Mac OS X (10.3.2)Thanks for the welcome Karsten! I’ve checked the installer disks – which appear to have all the main pieces of software, but not iDVD. If you or anyone knows where it might be hidden that would be great. Thanks for all the other info too!
Thanks Lennart – I don’t think my computer could support iLife ’05 as it is running Mac OSX 10.3.2 and I’ve just been looking at its system requirements which state it requires 10.3.4 minimum – if you know differently, please let me know. As an alternative I have considered getting iLife ’04, but your comment about iLife ’05 being the first version to support external drives worried me (“iDVD 5 is the first iDVD version that officially supports external burners“ does this mean there is an unofficial option for iLife ‘04? Perhaps a patch similar to the one mentioned by Karsten), does that mean iLife ’04 would not support an external Lacie DVD writer?
What is the earliest version of Toast I’d be able to use (as a money saving option!)?
Thank you both, and apoligies for my amateurish questions…
Kevin. -
like 2 weeks ago i called in to att to see how much is the data plan and it would end up costing $30.
so i was like screw that. well they figured that i got a new phone replacing the LG shine. so they asked
for to call this number so they can recieve data which would updated the system that i have a plam treo 750.
ever since this conflict i can't send picture messages. i get that problem. everytime i attempt to send a picture
i recieve this.
- there is a problem connection to the GPRS service in your registered home network.
- then i get a test that says error trying to make data connection. this may be casued by a voice call,
a wired activesync connection or inncorrect network setting.
please someone help me.
btw. hard reset and soft reset did not work for me.
Post relates to: Treo 750 (AT&T)problem fix, i had to call in. customer serivce. and when i called to ask about the plan. they blocked it. so i had to unblock my internet.
Post relates to: Treo 750 (AT&T)
Maybe you are looking for
-
Can I use ASA to be a DHCP Server use in WLC wireless Client
I want to use ASA to be a DHCP Server for Wireless Client not it can't. I check the debug log in WLC, I confirm the WLC have send the request to ASA. In the ASA, it don't have any hits in the rule when the WLC send the DHCP relay request. I have try
-
New software is completely ruining my iPhone 5
The new iPhone software Apple has come out with is completely destroying my iPhone. However, because my warranty has expired, Apple will not do anything to rectify the situation. Every time I go into an Apple Store they tell me there is nothing they
-
I am getting an error message with my snap scan ix500 that says the Evernote is not installed properly when I try to transfer it. I have uninstalled/reinstalled evernote and the scan snap softward but it still doesn't work. Anyone know where everno
-
How to setup a local CalDav/CardDav server to synch calendars and contacts
Since it is now not possible anymore to sync contacts and calendars without the cloud I would like to setup and CalDav/CardDav server in my local home (WiFi) network so that whenever my iOS devices are connected to that network calendars and contacts
-
I recently upgraded Firefox from 3.6 (I think it was) to 6.0.2. When I boot up Firefox now, my old Gadgets are gone and new "default" gadgets appear such as Weather (set for a town in Florida), Clock etc. I change these to ones I want (following the