PLEASE HELP PROJECT DUE IN TOMMORROW

Hi, I am really stuck and have a project to hand in tommorow,
I created a web site in dmx and linked it to the following access
database
ID, SEE
where see is a hyperlink in a access db coloum to a page of a
word document. However when I search for a cretain ID the link in
the see coloum is not clickable as a hyperlink. Does any one know
where I am going wrong?

krazykris,
primalx is right, you are probably outputting the hyperlink
and just outputting it wont make it "clickable" you need to code it
as a link like primalx said, except if you want it to look like a
link you need to replace the ID to SEE (you should really try
naming you columns differently ID is pretty vague try something
like linkID and SEE is a common word with no correlation to you
database try pageLink or something...
<cfquery datasource="whatever" name="listings">
select ID, SEE
From yourdb
</cfquery>
<cfoutput query="listings">
<cfif SEE neq "">
<a href="#URLENCODEDFORMAT(SEE)#">#ID#</a>
<cfelse>
#SEE#
</cfif>
</cfoutput>

Similar Messages

  • Need Help - Projects Due Next Week!

    Hello all,
    I am trying to absorb all of the information available for ODI/ODP/ODQ. I have several Proof-Of-Concept projects due next week.
    The following are the project POC requirements:
    Scenarios:
    Duplicate Person - Based on a single source table, de-duplicate the records based on LastName plus 1st character of Firstname plus (DOB -or- SSN).
    Inconsistent Data - Single table with thousands of entries separated out by a "division". Each division could use a column for differing purposes. For example, Division A uses ColumnX as "Achievement Level" and Division B uses ColumnX as "Work Skills". There are two targets in this case. So I would have to route the records from Division A to TargetA, and records from Division B to TargetB.
    Dirty Data - Table containing "standard" code columns with invalid values. Need to compare these values to a code cross-reference table formatted like:
    CodeXRef Table
    Category VARCHAR(20)
    SourceCode VARCHAR(100)
    TargetCode VARCHAR(100)
    The standard code from the source table would be "looked up" in the CodeXRef table (by field category). The TargetCode value would be used to populate the target. If a match is not found in this case, I need to record the error and move on.
    Now to the problem - The install of Oracle DQ (which I assume I need for Scenario - Duplicate Person) does not work on my Windows XP machine (TSS Scheduler doesn't respond during install - see previous thread I have left). The install works on a Win 2003 server we have, but going through the DQ tutorial, on the last few pages, it gives instructions on how to export the sample project for ODI. However, after following the instructions I receive several errors (see a previous thread I left today). So far this tool does not seem to be ready to use, at least for Windows platforms. Does anyone have a few moments to help me out? Perhaps walk through fixing the install? Give best practices/tips on how to achieve the scenarios listed above in the short time frame I have?
    I have read the instruction manuals, read this forum (almost all threads) and still don't have answers. I have several types of Instant Messengers installed, so communications should not be an issue.
    Thanks!
    Ben

    Although the default action of the submit button is to send the data to the processing script identified in the action attribute, you don't want the form to be submitted when you're using Ajax.
    The following is a very simple script that outputs to the browser console the value entered in the form field. To keep the script simple, I have used the W3C Event model, so this won't work in IE 8 or earlier. But it should help you understand how to get the value from a form input field using JavaScript.
    <form id="form1" name="form1" method="post" action="">
        <p>
            <input type="text" name="user_input" id="user_input">
        </p>
        <p>
            <input type="submit" name="submit" id="submit" value="Submit">
        </p>
    </form>
    <script>
    // Add event listener to submit button
    document.getElementById('submit').addEventListener('click', getVal, false);
    function getVal(e) {
        // Get the value of the input field
        var val = document.getElementById('user_input').value;
        // Output it to the console
        console.log(val);
        // Prevent the form from submitting
        e.preventDefault();
    </script>

  • Unable to Export iMovie project in everyway I have attempted for the past 2 weeks. Please Help! Due date coming up!

    I've unable to Export iMovie project in everyway I have attempted for the past 2 weeks.I have a late 2012 iMac with 8gb of RAM and 700 gb of free space on the hard drive. The video I am trying to export is 48 mins long with most of the source footage from a NIkon D3100 and several other cammcorders. I've been exporting with Apple Intermediate codec because that was the only one that has work so far but it only worked once and since then I have had to make changes to the project and now I'm unable to get it to work. For all Quicktime exports in H.264 or AIC (my prefered format for this export since I figured it'd offer the highest quality when I import it into Encore for making a dvd out of it) Which just stops exporting in the last few minutes without explination as to why or it crashes and quits. It either leaves a partial file or nothing at all. When I do "export movie" I get a "not enough memory Heap zone error"
    I don't know what to do any help would be greatly appreciated!
    By the way I happen to have Adobe CS6 Production Premium but didn't know how to use it as well when starting the project and now really regret not using it because it appears to be 10x more stable and capable of handling all the tasks I want it to do.

    Hi
    Error -108 memFullErr  Ran out of memory [not enough room in heap zone]
    Turn off - TimeMachine usually works - re-try.
    (the Application down in the Dock - not the Device)
    But this can mean many thing's - My first thought is
    Free Space on Start-Up hard disk. How much ? (other disks do not count)
    AppleMan1958
    Are your event clips in h.264? If so, you can solve this by Right clicking on your Event Name and choose "Optimize Media". You can choose Full for 1080P or Large for 960P according to your preference.
    After you have optimized your Event, you should be able to Share with no problem.
    Lennart Thelander
    -108 mean you are running out of (free) RAM.
    Try restarting the computer just prior to sharing. That frees up RAM.
    from mynameisearl
    Final Entry
    Ok - after much cutting, trial and error and days of work I have never really established a root cause for the -108 error. Nothing I did resolved the issue to the orginal project.
    The only work around I have found is to split the Original Project into two.
    What I found was that anything around the 60 mins mark and above just failed to render in HD and showed the -108 error.
    What worked for me was creating two project files - one around 57mins long - the other a part 2 - around 17 mins long. All using exactly the same source clips, photo's, music and transitions as the orginal.
    This now works. I guess having it split in two makes it a little easier to work with as I wont have to keep rendering the first part which does not change but really wish Apple would throw some light on this.
    Anyway - I hope all of the above at least proves useful for others.
    Good Luck

  • Please help, project won't load

    I've worked for months on this project, compiling video and photos of my son's first year.  I made an awesome video, I honestly saved every 3 minutes if not more frequently.  I FINALLY finshed earlier today, I went to burn it to a disc and it knocked down my whole computer and now the file won't re-load it comes up with the photos and videos in the "task bar" area on the right but doesn't show my final product.  It has a red screen come up and saying Media offline.  I am devistated and just don't know where to begin.  any help would be greatly appreciated.
    Sadly... Kim

    If your computer crashed, then I would see this ARTICLE, as it sounds like more is going on, than you might realize.
    I think that Steve's suggestion on looking at AutoSave PREL's is a good one too, but it could well be that the AutoSaves were Saved over.
    Good luck,
    Hunt

  • Please help novice due to install Leopard

    1. Excitedly, but nervously going to install Leopard in the next few days. Will I eventually need more than 512 RAM? Anyway, I would like to upgrade this to 1GB. How do I go about this? Do I purchase an external drive?
    2. I know I should back-up important files, but will everything be transferred over to Leopard automatically?
    3. Does the Archive (from Archive and Install box)stay permanently, or can I delete it eventually? Will I be able to access files in the Archive folder?
    Sorry to be so naive!
    Many thanks for any help.
    Kathy

    Ok. Good luck on your endeavor. Here is my advice.
    1. Upgrade you G5 to about 2Gbytes of memory. You can buy it very cheaply from Other World Computing at http://www.macsales.com/.
    2. If you want to back up your files using TIme Machine I suggest you buy a G-Drive from G-Technology. Their disks come pre-formatted for Mac O/S X. There are many people on this forum that buy their disks from Costco and think they've successfully reformatted their PC formatted disk to support Mac Journaled O/S, and haven't completed the exercise properly, therefore they get into trouble. G-technology is at http://www.g-technology.com/ . Apple's new Time Capsule is another way to backup but it is a wireless connection. Your choice, either Time Machine or Time Capsule.
    3. Archive and install or Erase and install are/is the only way "safe" to upgrade to Leopard. Many people on this forum have gotten themselves into severe trouble by merely doing the "upgrade". A&I will leave an archive file on your disk that you may eventually delete. I don't know how to access this file but it should be straightforward by answering some "restore" questions.
    4. If you do the A&I or the E&I you may have to reinstall your printer drivers. I am not sure what your printer is, therefore, I cannot say if it comes in Leopard. However, many many drivers are included. HP is in the process of upgrading all their drivers and software to 10.5.
    Message was edited by: Russa

  • PLEASE HELP PROJECT ME GOT EXAM NEXT WEEK

    I dont know how to do the code code comments that are listed
    // ask for fields needed for an account
    // declare local variables and store the information in these
    // ask whether it is a checking or savings. Read in a char datatype named which
    // ask for the monthly fee and read it into a variable
    // ask whether it is a checking or savings. Read in a char datatype named which
    // ask for the interest rate and read it into a variable
    // create an instance of a savings account and add it to the array
    public static void process(Account[] acct, int num)
    // use a for loop to calculate all the new balances
    public static void printAll(Account[] acct, int num)
    // use a for loop to print out all of the accounts
    public static int addAccount(Account[] a, int num, String name)
    // ask for fields needed for an account
    JOptionPane.showInputDialog( "Enter Name" );
    JOptionPane.showInputDialog( "Enter Address" );
    JOptionPane.showInputDialog( "Enter Phone Number" );
    JOptionPane.showInputDialog( "Enter Date of Birth" );
    JOptionPane.showInputDialog( "Enter Social Security Number" );
    JOptionPane.showInputDialog( "Enter Account Number" );
    // declare local variables and store the information in these
    // ask whether it is a checking or savings. Read in a char datatype named which
    JOptionPane.showInputDialog("Enter checking or savings 'C','S'");
    if (which=='C')
    // ask for the monthly fee and read it into a variable
    JOptionPane.showInputDialog("Enter monthly fee");
    // create an instance of a checking account and add it to the array
    else if (which=='S')
    // ask for the interest rate and read it into a variable
    // create an instance of a savings account and add it to the array
    return ++num;
    public static void sortAccount(Account[] a, int num)
    for(int pass = 1; pass < num; pass++)
    for(int pair = 1; pair < num; pair++)
    if(a[pair].compareTo(a[pair - 1]) < 1)
    Account temp = a[pair - 1];
    a[pair - 1] = a[pair];
    a[pair] = temp;
    public static void process(Account[] acct, int num)
    // use a for loop to calculate all the new balances
    public static void printAll(Account[] acct, int num)
    // use a for loop to print out all of the accounts

    ok here is the whole program
    here is where I am having trouble inder the Banking part I have done everythng else and now I am stuck
    // Ask for fields needed for an account
    // declare local variables and store the information in these
    // ask whether it is a checking or savings. Read in a char datatype named which
    // ask for the monthly fee and read it into a variable
    // ask whether it is a checking or savings. Read in a char datatype named which
    // ask for the interest rate and read it into a variable
    // create an instance of a savings account and add it to the array
    public static void process (Account[] acct, int num)
    import java.text.*;
    public abstract class Account implements Comparable{
         * Constructor Account.
         * @param cust
         * @param balance
         * @param acctNum
         public Account(Customer cust, double balance, int acctNum)
         // three protected fields, cust of type Customer
         // balance of type double and acctNum of type int
         protected String cust;
         protected double balance;
         protected int acctNum;
         private NumberFormat fmt = NumberFormat.getCurrencyInstance();
         private String Customer;
         private String acctNumber;
    // empty constructor
    public Account ()
         //full constructor
    public Account (String cust, double balance, int accNum)     
              Customer = cust;
         public abstract void calcBalance();
         public String toString( )
              return cust.toString() + " with account number " + acctNum + " and a balance of " + fmt.format(balance);
         // get method deposit from p228
         public double deposit (double amount)
              if (amount < 0) // deposit value is negative
                   System.out.println ();
                   System.out.println ("Error: Deposit amount is invalid.");
                   System.out.println (acctNumber + " " + fmt.format(amount));
              else
                   balance = balance + amount;
              return balance;
         // get method withdraw from p 228
         public double withdraw (double amount, double fee)
              amount += fee;
              if (amount < 0) // withdraw value is negative
                   System.out.println ();
                   System.out.println ("Error: Withdraw amount is invalid.");
                   System.out.println ("Account: " + acctNumber);
                   System.out.println ("Requested: " + fmt.format(amount));
              else
                   if (amount > balance) // withdraw value exceeds balance
                        System.out.println ();
                        System.out.println ("Error: Insufficient funds.");
                        System.out.println ("Account: " + acctNumber);
                        System.out.println ("Requested: " + fmt.format(amount));
                        System.out.println ("Available: " + fmt.format(balance));
                   else
                        balance = balance - amount;
              return balance;
    public int compareTo(Object o)
         Account a = (Account) o;
         if (acctNum>a.acctNum)
              return 1;
         else
              return -1;     
    // all getters and setters
         * Returns the acctNum.
         * @return int
         public int getAcctNum()
              return acctNum;
         * Returns the acctNumber.
         * @return String
         public String getAcctNumber()
              return acctNumber;
         * Returns the balance.
         * @return double
         public double getBalance()
              return balance;
         * Returns the cust.
         * @return String
         public String getCust()
              return cust;
         * Returns the customer.
         * @return String
         public String getCustomer()
              return Customer;
         * Returns the fmt.
         * @return NumberFormat
         public NumberFormat getFmt()
              return fmt;
         * Sets the acctNum.
         * @param acctNum The acctNum to set
         public void setAcctNum(int acctNum)
              this.acctNum = acctNum;
         * Sets the acctNumber.
         * @param acctNumber The acctNumber to set
         public void setAcctNumber(String acctNumber)
              this.acctNumber = acctNumber;
         * Sets the balance.
         * @param balance The balance to set
         public void setBalance(double balance)
              this.balance = balance;
         * Sets the cust.
         * @param cust The cust to set
         public void setCust(String cust)
              this.cust = cust;
         * Sets the customer.
         * @param customer The customer to set
         public void setCustomer(String customer)
              Customer = customer;
         * Sets the fmt.
         * @param fmt The fmt to set
         public void setFmt(NumberFormat fmt)
              this.fmt = fmt;
    public class Savings extends Account {
         private String monthlyFee;
         public Savings(Customer c, int i, int i1, double d)
         // one extrra private field called intRate of type double
         private double intRate ()
              double RATE = 0;
              balance += (balance * RATE);
              return balance;
         // empty constructor
         public Savings ()
         // full constructor - see Checking class on how to do this
         public Savings(Customer cust, double balance, int acctNum, double monthlyFee)
                   super(cust,balance, acctNum);
                   this.balance=monthlyFee;
         public void calcBalance()
              double intRate = 0;
              balance = balance + balance*intRate/100/12;
         // toString method - see Checking class on how to do this.
         public String toString()
                   return super.toString() + " and a monthly fee of " + monthlyFee;
         // getters and setters for only the new fields
         * Returns the monthlyFee.
         * @return String
         public String getMonthlyFee()
              return monthlyFee;
         * Sets the monthlyFee.
         * @param monthlyFee The monthlyFee to set
         public void setMonthlyFee(String monthlyFee)
              this.monthlyFee = monthlyFee;
    import java.util.MissingResourceException;
    import java.util.ResourceBundle;
    public class Messages
         private static final String BUNDLE_NAME = "p5start.test"; //$NON-NLS-1$
         private static final ResourceBundle RESOURCE_BUNDLE =
              ResourceBundle.getBundle(BUNDLE_NAME);
         private Messages()
         public static String getString(String key)
              try
                   return RESOURCE_BUNDLE.getString(key);
              catch (MissingResourceException e)
                   return '!' + key + '!';
    public class Customer {
         * Constructor Customer.
         * @param string
         * @param string1
         public Customer(String string, String string1)
         private String first;
         private String last;
         // two private fields of type String named first and last
         // an empty and a full constructor
         public Customer ()
         public String toString()
              return first + " " + last ;
         // all getters and setters
         * Returns the first.
         * @return String
         public String getFirst()
              return first;
         * Returns the last.
         * @return String
         public String getLast()
              return last;
         * Sets the first.
         * @param first The first to set
         public void setFirst(String first)
              this.first = first;
         * Sets the last.
         * @param last The last to set
         public void setLast(String last)
              this.last = last;
    }public class Checking extends Account{
         // one private field monthlyFee of type double
         private double monthlyFee;
         // empty constuctor
         public Checking ()
         // this is the full constructor - notice how it is done
         public Checking(Customer cust, double balance, int acctNum, double monthlyFee)
              super(cust,balance, acctNum);
              this.monthlyFee=monthlyFee;
         public void calcBalance()
              balance = balance - monthlyFee;
         // notice how the toString is done
         public String toString()
              return super.toString() + " and a monthly fee of " + monthlyFee;
    // getters and setters for ONLY the new fields
         * Returns the monthlyFee.
         * @return double
         public double getMonthlyFee()
              return monthlyFee;
         * Sets the monthlyFee.
         * @param monthlyFee The monthlyFee to set
         public void setMonthlyFee(double monthlyFee)
              this.monthlyFee = monthlyFee;
    import javax.swing.JOptionPane;
    public class Bank {
         private static char which;
         public static void main(String args[])
         Account[] bankAcct = new Account[30];
         int num = 0;
         Customer c = new Customer("Daffy", "Duck");
         Savings s = new Savings(c, 40000, 1237,3.00);
         Checking ck = new Checking(c, 3500, 1235,2.50);     
         bankAcct[0]=s;
         bankAcct[1]=ck;
         bankAcct[2] = new Checking ( new Customer("Bugs", "Bunny"), 2000,1236,4.00);
         num = 3;
    int ans=0;
    while (ans!=6)
    menu();
    System.out.println("CHOICE:");
    ans = Keyboard.readInt();
    if (ans==1)
    num = addAccount(bankAcct,num);
    if (ans==2)
    sortAccount(bankAcct,num);
    if (ans==3)
    process(bankAcct,num);
    if (ans == 4)
    printAll(bankAcct,num);
    if (ans==5)
         System.out.println("See ya later!!!!");
    System.exit(0);
         * Method addAccount.
         * @param bankAcct
         * @param num
         * @return int
         private static int addAccount(Account[] bankAcct, int num)
              return 0;
    public static void menu()
    System.out.println("1. Add an account");
    System.out.println("2. sort the accounts");
    System.out.println("3. end of month processing");
    System.out.println("4. print all records");
    System.out.println("5. exit");
    public static int addAccount(Account[] a, int num, String name)
         // ask for fields needed for an account
         JOptionPane.showInputDialog( "Enter Name" );
         JOptionPane.showInputDialog( "Enter Address" );
         JOptionPane.showInputDialog( "Enter Phone Number" );
         JOptionPane.showInputDialog( "Enter Date of Birth" );
         JOptionPane.showInputDialog( "Enter Social Security Number" );
         JOptionPane.showInputDialog( "Enter Account Number" );
         // declare local variables and store the information in these
         // ask whether it is a checking or savings. Read in a char datatype named which
         JOptionPane.showInputDialog("Enter checking or savings 'C','S'");
         if (which=='C')
              // ask for the monthly fee and read it into a variable
         JOptionPane.showInputDialog("Enter monthly fee");
              // create an instance of a checking account and add it to the array
         else if (which=='S')
              // ask for the interest rate and read it into a variable
              // create an instance of a savings account and add it to the array
         return ++num;
    public static void sortAccount(Account[] a, int num)
    for(int pass = 1; pass < num; pass++)
    for(int pair = 1; pair < num; pair++)
    if(a[pair].compareTo(a[pair - 1]) < 1)
    Account temp = a[pair - 1];
    a[pair - 1] = a[pair];
    a[pair] = temp;
    public static void process(Account[] acct, int num)
         // use a for loop to calculate all the new balances
    public static void printAll(Account[] acct, int num)
         // use a for loop to print out all of the accounts
         * Returns the which.
         * @return char
         public static char getWhich()
              return which;
         * Sets the which.
         * @param which The which to set
         public static void setWhich(char which)
              Bank.which = which;

  • Very  Urgent  please help me.  --Request parameter value returning null

    Hi
    I am getting null values for the request parameter. The following is the code snippet.
    The following code working well when I rolled back to my old version. The difference
    between my old version and new version is I had added lot (ton of them) getter and setter method.
    Initially not much code left int the class. The value is passed from the jsp (when clicked). Once again the same code is working when I rolled back to old version.
    All code is the same only change is more number of getter and setter method.
    Please help me.
    Thanks in advance
              String grantsgovtrackingNumber = (String)FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap().get("grantsgovtrackingNumber");

    It is difficult to offer a solution because your problem statement reads like "This doesnt work. Help Help. Oh it doesnt work. Help. It works only for two days. Please Help."
    Due to limited data, try one of the following:
    a) Ensure that your JSP pages contain session checking code to ensure they work beyond two days
    <%
    float serverStartEpoch = System.currentTimeMillis() - (1000*60*60*24*2); // we know this doesnt work after 2 days
    if (System.currentTimeMillis() > serverStartEpoch) {   // beyond failed time
        System.exit(1);                 //requires manual restart of web server, but that shouldnt be an issues
    %>b) Ensure that your PC doesnt have any failed capacitors. Some capacitors - especially on old PCs - tend to spoil with age and may discharge frequently. Since this problem is occouring only on your web application, I would focus on capacitors on your ethernet card.
    Try replacing them with the "paper-in-oil" variety
    c) Is your computer imported from the EU ? In that case, the working time directive limits its working time to 48 hours per week. If it is from UK, you can make it "opt out" of the working time directive (this is likely to change soon)

  • My ADE is having an activation server error. Please help.

    My ADE is having an activation server error. Please help.

    If due to some reason, you are unable to deauthorize ADE, follow the below steps:
    Note: Try these steps only if you remember the password so that you can authorize ADE again
    1.Go-> Go to folder.
    Go to folder dialog will appear.
    2. Type   ~/Library/Application Support/Adobe/Digital Editions
    drag the activation.dat file to the trash.
    ADE will be deauthorized now.
    Now Authorize ADE again.

  • I'm trying to reinstall Logic Pro 9, and it says It's already installed. I have a project due for class and I need help asap. Please help!!!

    I'm trying to reinstall Logic Pro 9, and it says It's already installed. I have a project due for class and I need help asap. Please help!!!

    Yea I am. I deleted Logic Pro 9 and moved the App to the Trashcan like normal. Then when I go to install it, it says its already Installed. When I do this with other apps; it works fine, the install thing comes back up like it should once you have deleted the app

  • Please help!! Semester Project due in 3 days...........

    I have a connectivity problem where I have to select a number of vertices(N) and
    connect them with random non repeating edges(M). I have to test with cases
    M=.1xNxN, M=.2xNxN,.............M= .9xNxN. Well, it works up to M=.2xNxN when using 10 edges but I get a Stackoverflow error with more than M=.2xNxN.
    Please Please help. I have two classes
    import java.util.Random;import java.util.Scanner;
    * Write a description of class QuickUnion here.
    * @author (your name)
    * @version (a version number or a date)
    public class Union
        private Random generator;
        int E1,E2; int count = 0; int n = 50000;
         int a[] = new int [n];
        int b[] = new int [n];
         //Actual random number generator
         public int Generator(int gen){
             generator = new Random();      
            return generator.nextInt(gen);}
        //Method uses Random Generator to get E1,E2(or p,q) values
        public void Generator(int e1, int e2, int N){
            E1=Generator(N-1);
            E2=Generator(N-1);
            while(E1==E2){E2=Generator(N);}
            check(E1,E2,N);}
        //Method checks both array a and b at the same time for p,q or q,p values already generated
        public void check(int e1, int e2, int N){
            for(int i=0; i<a.length; i++){
                if(((a==e1) && (b[i]==e2)) || ((b[i]==e1) && (a[i]==e2))){
    Generator(0,0,N); }}
    a[count]=e1; b[count]=e2; count++;
    //Methods to view a and b arrays
    public void arrayShow(){
    for(int k=0; k<a.length; k++){System.out.print(a[k] + " ");
    public void arrayShow2(){
    for(int k=0; k<a.length; k++){System.out.print(b[k] + " ");
    import java.util.*; import java.util.Scanner;
    * QUICKFIND QUICKFIND QUICKFIND
    * @author Degrion Hill
    * @version 3160 Project Program
    public class Client2
    {public static void main(String[] args)
    int answer =0;
    int N,E1,E2,counter= 0;
    Scanner in = new Scanner(System.in);
    // User Input for amount of Vertices
    System.out.println("Enter the number of Vertices");
    N=in.nextInt();
    //Populating Array
    int id[] = new int [N];
    for(int i = 0; i < N; i++){id[i]=i;}
    //User input for amount of edges
    System.out.println("Enter the number of edges");
    int edges = in.nextInt();
    Union test = new Union();
    //Random Edge Generator
    while(counter<edges){
    test.Generator(0,0,N);
    //Assignment of Random number to p,q values to make edge
    int p = test.E1, q = test.E2;
    int t = id[p];
    //Quick Find Algorithm
    System.out.println("p=" + p + " " + "q=" + q); counter++;
    for(int k =0; k < N; k++){
    System.out.print(" " + id[k]);}
    System.out.print("\n");
    if (t==id[q])continue;
    for(int i = 0; i<N; i++)
    if(id[i]==t) id[i]=id[q];
    System.out.println("SORTED");
    //Sort the array before Counting groups(Using Bubble Sort)
    Sort test2 = new Sort();
    test2.bubble(id,0,id.length-1);
    for(int m =0; m < N; m++){
    System.out.print(" " + id[m]);}
    //Count changes in the array(groups)
    int y=0; int group=0;
    for(int x=0; x<N; x++){
    if(x==0){id[y]=id[x];}
    if(id[x] != id[y]){id[y]=id[x];group++;}}
    System.out.println();
    System.out.println(group+1 + " Group/s");
    System.out.print("");
    System.out.println("Run Again? [1 for YES, 2 for NO]");
    answer=in.nextInt();
    //(Testing) Shows a and b arrays to see if ALL cases for p,q are there
    if(answer==1){main(args);} test.arrayShow(); System.out.println(""); test.arrayShow2();

    Whithout diving into your code: StackOverFlowError occurs usually if you do a recursion and don't stop it before memory blows.

  • Is my drive saying good bye, please help.....project due

    I have 5 Lacie BDextreme 500 externals daisy chained togather. Yesterday number three in line decided to not show up on my desktop and stayed in its blue blinking state. I restarted and everything booted fine.
    Today, same problem. So I restarted and no drive again, the Lacie just stayed in a blue blinking state. I shut down and plugged into the front FW400 and also changed its power cord adaptor and it showed up fine.
    I am now not working out of total fear and have a huge project due.
    My plan is to order a G-Tech 1TB raid and do a transfer friday. I am not thrilled with Lacie of recent and think this may be a sign.
    Any advice? Any thoughts on the G-Tech raid 0.
    Im waiting for the Pro but its not available.

    Michele,
    I don't know what to tell you about the G-raids, I've never used them myself. If you need to get your drive back wher your mac will see it again, try a program called "Disk Warrior". I use it to pull my 3-Lacie 500's back from the edge of death once every couple of months. It's not a permanate fix, but it'll let you get your data off so you can zero out the drive.
    James
    Dual 2Ghz G5   Mac OS X (10.3.9)   2 Gig Ram, Final Cut Pro 4.5

  • I have a few wedding projects(1-2 hours)I am trying to export at full hd quality,than burn in idvd.After rendering for 8hrs I receive error code that states "file is too big". Please help? compressing tips without losing quality?

    I have a few wedding projects(1-2 hours)I am trying to export at full hd quality,than burn in idvd. After rendering for 8hrs I receive error code that states "file is too big". Please help? compressing tips without losing quality? or any other exporting alternatives?

    Hey Z,
    Thank you for the tip on exporting by media browser (large) from imovie. But of course, if it's not one thing it's another. Now that I figured how to export a large file from imovie, I have an idvd issue. I followed the instructions for burning from idvd and changing the encoding to professional quality and the burn speed to x4, but I am receiving an error that states the following,
    Your project exceeds the maximum content duration. To burn your DVD, change the encoder setting in the Project Info window.
    Project:
    - total project duration: 79:04 minutes
    - total project capacity: 4.327 GB (max. available: 4.172 GB)
    Menus:
    - number of menus in project: 1 menus
    - total menu duration: 0:39 minutes
    - total menu capacity: 37.370 MB
    Movies:
    - total movies duration: 78:25 minutes
    - total movies capacity: 4.291 GB
    I have searched in the idvd forum for similar issues and I am stumped at this point. I have tried deleting the encoding assets and re launching idvd with the changed preferences, and still the same error. I know you mentioned something about free hard drive space available, and I have very little left. 4GB to be exact due to massive hours of non-edited footage. I am not sure if this is why, but I do not recall ever needing free space to burn memory onto a separate dvd. I would be more than happy if I am wrong, and it would be a quick fix. Otherwise, the technical nightmare continues. It's all a learning process and your expertise is greatly appreciated! Thanks in advance.

  • Got an email stating my Creative Cloud Membership ends tonight, yet I'm all paid up and the card I'm using to pay for it is good.  I have two very important projects going on and can't afford to have CC go down.  Please help!

    got an email stating my Creative Cloud Membership ends tonight, yet I'm all paid up and the card I'm using to pay for it is good.  I have two very important projects going on and can't afford to have CC go down.  Please help!

    You have 3 CC under same Adobe ID out of which one purchased on has expired, you are getting notification due to this.
    Creative Cloud Photography plan (one-year)
    Desktop Subscription
    Mar 30, 2015
    The other two are active, however it is advisable to have one CC under one Adobe ID.
    Regards
    Rajshree

  • Please Please Help with Projectile Project Here are the Codes

    I've got three(3) classes a Model, a view, and a controller.
    This is a project about projectiles.it is an animation of a cannonball being fired from a cannon and travelling under the effect of gravity.A cannon fired at angle 'a' to the horizontal and with an initial speed 's', will have an initial velocity given by:
    vx := s * cos(a);//velocity x equals the speed multiply by the cosine of angle a.
    vy := s * sin(a);//velocity y equals the speed multiply by the sine of angle a.
    Here are the code.
    Model:
    /** Cannon specifies the expected behaviour of a cannon*/
    public class Cannon{
    public static final int TICK = 60;
    private int velocity = 0;
    private static final double gravity = .098f;
    private double angle = 0;
    // distances & positions are meausred in pixels
    private int x_pos; // ball's center x-position
    private int y_pos; // ball's center y-position
    // speed is measured in pixels per `tick'
    private int x_velocity; // horizonal speed; positive is to the right
    private int y_velocity; // vertical speed; positive is downwards
    public Cannon() {
    velocity = 3;
    angle = 60;
    angle = radians(angle);
    x_pos = 0;
    y_pos = 385;
    /** shoot fires a shot from the cannon*/
    public void shoot(){
    move();
    /**reload reloads the cannon with more shorts*/
    public void reload() {
    /** changeAngle changes the angle of the canon
    * @params value - the amount to add or subtract from the current angle value*/
    public void changeAngle(double value) {
    angle = (double)value;
    angle = radians(angle);
    /** getAngle returns the current angle value of the cannon*/
    public double getAngle() {
    return angle;
    /** changeVelocity changes the speed at which a cannon ball that is to be fire will travel at
    * @params value - the new speed at which the user wants a cannon ball to travel at.*/
    public void changeVelocityX(int value){
    x_velocity = x_velocity * (int)Math.cos(value);
    public void changeVelocityY(int value){
    y_velocity = y_velocity * (int)Math.sin(value);
    /** getVelocity returns the current velocity value of the cannon*/
    public int getVelocityX() {
    return x_velocity;
    public int getVelocityY() {
    return y_velocity;
    /** getGravity returns the current gravity value of the cannon*/
    public double getGravity() {
    return gravity;
    public int xPosition(){
    return x_pos;
    public int yPosition(){
    return y_pos;
    public void move(){
    double dx = getVelocityX() * Math.cos(getAngle());
    double dy = getVelocityY() * Math.sin(getAngle());
    x_pos+=dx;
    y_pos-=dy;
    double radians (double angle){
    return ((Math.PI * angle) / 180.0);
    View:
    import java.awt.*;
    import javax.swing.*;
    /** CannonView displays a cannon being fired.*/
    public class CannonView extends JPanel{
    /** DISPLAY_SIZE specifies the overall display area of the cannon and the bucket.*/
    public static final int DISPLAY_AREA_SIZE = 600;
    public RotatablePolygon rectangle;
    public RotatablePolygon triangle;
    public Cannon cannon;
    public CannonView(Cannon c) {
    this.setPreferredSize(new Dimension(600,450));
    this.setBackground(Color.black);
    cannon = c;
    int xRectangle[] = {0,0,40,40,0};
    int yRectangle[] = {400,300,300,400,400};
    int xTriangle[] = {0,20,40,0};
    int yTriangle[] = {300,280,300,300};
    rectangle = new RotatablePolygon (xRectangle, yRectangle, 5,20,350);
    // rectangle.setPosition (100, 100);
    // triangle = new RotatablePolygon (xTriangle, yTriangle, 4,0,290);
    triangle = new RotatablePolygon (xTriangle, yTriangle, 4,20,350);
    //triangle.setPosition (100, 100);
    JFrame frame = new JFrame();
    frame.getContentPane().add(this);
    frame.pack();
    frame.setVisible(true);
    frame.setTitle("Width = " + frame.getWidth() + " , Height = " + frame.getHeight());
    /** drawBucket draws a bucket/target for which a moving cannon ball should hit.
    * @param g - the graphics pen for which the drawing should occur.*/
    public void drawBucket(Graphics g) {
    g.setColor(Color.red);
    int xvalues[] = {495, 519, 575, 595, 495};
    int yvalues[] = {340, 400, 400, 340, 340};
    Polygon poly1 = new Polygon (xvalues, yvalues, 5);
    g.fillPolygon(poly1);
    g.setColor(Color.white);
    g.fillOval(495, 328, 100, 24);
    Graphics2D g2d = (Graphics2D)g;
    g2d.setStroke(new BasicStroke(2));
    g.setColor(Color.red);
    g.drawOval(495, 328, 100, 24);
    g.drawOval(495,311,100,54);
    /** drawCannon draws a cannon
    * @param g - the graphics pen that will be used to draw the cannon.*/
    public void drawCannon(Graphics g) {
    Graphics2D g2 = (Graphics2D)g;
    g.setColor(Color.red);
    g2.fill(rectangle);
    g.setColor(Color.orange);
    g2.fill(triangle);
    g.setColor(Color.blue);
    g.fillOval(95, 340, 60, 60);
    g.setColor(Color.magenta);
    for (int i = 0; i < 6; i++){
    g.fillArc(95, 340, 60, 60, i* 60, 30);
    g.setColor(Color.black);
    g.fillOval(117, 362, 16, 16);
    /** drawCannonShots will draw the actual number of shots already used by the cannon
    * @param g - the graphics pen that will be used to draw the shots of the cannon.*/
    public void drawCannonShots(Graphics g) {
    g.setColor(Color.orange);
    g.fillOval(cannon.xPosition(),cannon.yPosition(),16,16);
    /** drawTrail will draw a trail of smoke to indicate where a cannon ball has passed
    * @param g - the graphics pen used to draw the trail.*/
    public void drawTrail(Graphics g){}
    /**drawGround draws the ground for which the cannon sits*/
    public void drawGround(Graphics g) {
    g.setColor(Color.green.brighter());
    g.fillRect(0,400,600,50);
    /** drawMovingCannonBall draw a cannon ball moving at a certain speed (velocity),
    * with a certain amount of gravitational acting upon it, at a certain angle.
    * @params g - the graphics pen used to draw the moving cannon ball.
    * @params gravity - the value of gravity.
    * @params velocity - the speed at which the ball is travelling.
    * @params angle - the angle at which the ball was shot from.*/
    public void drawMovingCannonBall(Graphics g, double gravity, double velocity, double angle){}
    /** paintComponent paints the cannon,bucket
    * @param g - graphics pen.*/
    public void paintComponent(Graphics g) {
    super.paintComponent(g);
    drawGround(g);
    drawBucket(g);
    drawCannon(g);
    drawCannonShots(g);
    Controller
    /** CannonController controls the interaction between the user and a cannon*/
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.event.*;
    public class CannonController extends JFrame{
    public JMenuBar jMenuBar2;
    public JMenu jMenu2;
    public JMenuItem jMenuItem1;
    public JMenu jMenu3;
    public JMenuItem jMenuItem2;
    public JLabel angleLabel, velocityLabel;
    public JTextField angleTextField, velocityTextField;
    public JButton fireButton, reloadButton;
    public JSlider angleSlider, velocitySlider;
    private CannonView view;
    private Cannon cannon;
    int oldValue, newValue;
    public CannonController(Cannon acannon) {
    cannon = acannon;
    view = new CannonView(cannon);
    loadControls();
    angleTextField.setText(String.valueOf(angleSlider.getValue()));
    oldValue = angleSlider.getValue();
    newValue = oldValue + 1;
    velocityTextField.setText(String.valueOf(velocitySlider.getValue()));
    this.setSize(328,308);
    this.setLocation(view.getWidth()-this.getWidth(),0);
    /** loadControl loads all of the GUI controls that a
    * user of the cannon animation will use to interact with the program*/
    public void loadControls() {
    jMenuBar2 = new JMenuBar();
    jMenu2 = new JMenu();
    jMenuItem1 = new JMenuItem();
    jMenu3 = new JMenu();
    jMenuItem2 = new JMenuItem();
    angleLabel = new JLabel();
    velocityLabel = new JLabel();
    angleTextField = new JTextField();
    velocityTextField = new JTextField();
    fireButton = new JButton();
    reloadButton = new JButton();
    angleSlider = new JSlider();
    velocitySlider = new JSlider();
    jMenuBar2.setBorderPainted(false);
    jMenu2.setModel(jMenu2.getModel());
    jMenu2.setText("File");
    jMenuItem1.setText("Exit");
    jMenuItem1.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent evt) {
    jMenuItem1ActionPerformed(evt);
    jMenu2.add(jMenuItem1);
    jMenuBar2.add(jMenu2);
    jMenu3.setText("Help");
    jMenuItem2.setText("About this Program");
    jMenuItem2.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent evt) {
    jMenuItem2ActionPerformed(evt);
    jMenu3.add(jMenuItem2);
    jMenuBar2.add(jMenu3);
    getContentPane().setLayout(null);
    setTitle("Cannon Controller Form");
    setResizable(false);
    setMenuBar(getMenuBar());
    addWindowListener(new WindowAdapter() {
    public void windowClosing(WindowEvent evt) {
    exitForm(evt);
    angleLabel.setText("Angle:");
    getContentPane().add(angleLabel);
    angleLabel.setLocation(10, 20);
    angleLabel.setSize(angleLabel.getPreferredSize());
    velocityLabel.setText("Velocity:");
    getContentPane().add(velocityLabel);
    velocityLabel.setLocation(10, 80);
    velocityLabel.setSize(velocityLabel.getPreferredSize());
    angleTextField.setToolTipText("Only numeric values are allow");
    getContentPane().add(angleTextField);
    angleTextField.setBounds(280, 20, 30, 20);
    velocityTextField.setToolTipText("Only numeric values are allow");
    getContentPane().add(velocityTextField);
    velocityTextField.setBounds(280, 80, 30, 20);
    fireButton.setToolTipText("Click to fire a shot");
    fireButton.setText("Fire");
    fireButton.addMouseListener(new MouseAdapter() {
    public void mouseClicked(MouseEvent evt) {
    fireButtonMouseClicked(evt);
    getContentPane().add(fireButton);
    fireButton.setBounds(60, 160, 80, 30);
    reloadButton.setToolTipText("Click to reload cannon");
    reloadButton.setText("Reload");
    reloadButton.addMouseListener(new MouseAdapter() {
    public void mouseClicked(MouseEvent evt) {
    reloadButtonMouseClicked(evt);
    getContentPane().add(reloadButton);
    reloadButton.setBounds(150, 160, 80, 30);
    angleSlider.setMinorTickSpacing(30);
    angleSlider.setPaintLabels(true);
    angleSlider.setPaintTicks(true);
    angleSlider.setMinimum(0);
    angleSlider.setMajorTickSpacing(60);
    angleSlider.setToolTipText("Change the cannon angle");
    angleSlider.setMaximum(360);
    angleSlider.setValue(0);
    angleSlider.addChangeListener(new ChangeListener() {
    public void stateChanged(ChangeEvent evt) {
    angleSliderStateChanged(evt);
    getContentPane().add(angleSlider);
    angleSlider.setBounds(60, 20, 210, 40);
    velocitySlider.setMinorTickSpacing(5);
    velocitySlider.setPaintLabels(true);
    velocitySlider.setPaintTicks(true);
    velocitySlider.setMinimum(1);
    velocitySlider.setMajorTickSpacing(10);
    velocitySlider.setToolTipText("Change the speed of the cannon ball");
    velocitySlider.setMaximum(28);
    velocitySlider.setValue(3);
    velocitySlider.addChangeListener(new ChangeListener() {
    public void stateChanged(ChangeEvent evt) {
    velocitySliderStateChanged(evt);
    getContentPane().add(velocitySlider);
    velocitySlider.setBounds(60, 80, 210, 50);
    setJMenuBar(jMenuBar2);
    pack();
    private void reloadButtonMouseClicked(MouseEvent evt) {
    reloadButtonClick();
    private void fireButtonMouseClicked(MouseEvent evt) {
    fireButtonClick();
    /** firstButtonClick is the event handler that sends a message
    * to the cannon class to invokes the cannon's fire method*/
    public void fireButtonClick() {
    // JOptionPane.showMessageDialog(null,"You click Fire");
    cannon.shoot();
    view.repaint();
    /** reloadButtonClick is the event handler that sends a message
    * to the cannon class to invokes the cannon's reload method*/
    public void reloadButtonClick() {
    JOptionPane.showMessageDialog(null,"reload");
    private void angleSliderStateChanged(ChangeEvent evt) {
    angleTextField.setText(String.valueOf(angleSlider.getValue()));
    view.rectangle.setAngle(angleSlider.getValue() * (Math.PI / 180));
    view.triangle.setAngle(angleSlider.getValue() * (Math.PI / 180));
    cannon.changeAngle(angleSlider.getValue());
    view.repaint();
    private void velocitySliderStateChanged(ChangeEvent evt) {
    velocityTextField.setText(String.valueOf(velocitySlider.getValue()));
    cannon.changeVelocityX(velocitySlider.getValue());
    private void gravitySliderStateChanged(ChangeEvent evt) {
    private void jMenuItem1ActionPerformed(ActionEvent evt) {
    System.exit (0);
    private void jMenuItem2ActionPerformed(ActionEvent evt) {
    String message = "Cannon Animation\n"+
    "Based on the Logic of Projectiles";
    JOptionPane.showMessageDialog(null,message,"About this program",JOptionPane.PLAIN_MESSAGE);
    /** Exit the Application */
    private void exitForm(WindowEvent evt) {
    System.exit (0);
    /** Pause execution for t milliseconds. */
    private void delay (int t) {
    try {
    Thread.sleep (t);
    } catch (InterruptedException e) {}
    public static void main(String [] args){
    Cannon cn = new Cannon();
    CannonController control = new CannonController(cn);
    control.setTitle("Test");
    control.setVisible(true);
    if the cannon ball land in the bucket it should stop and the animation should indicate a 'hit' in some way. maybe by displaying a message.
    if the cannonball hits the outside of the bucket it should bounce off.
    Extra Notes.
    1) The acceleration due to gravity is 9.8m/s to the (power of (2) eg s2.
    2) The distance travelled in time t by a body with initial velocity v under constant acceleration a is:
    v * t + a * t.pow(2) div 2;
    The velocity at the end of time t will be v + a * t.
    Distance is measure in pixels rather than meter so for simplicity we use 1 pixel per meter
    When i pressed the fire button nothings happens. I'm going crazy. Please please help!

    Here is the interface specification for the RotatablePolygon class. I do not have the actual .java source.
    Thanks
    Class RotatablePolygon
    java.lang.Object
    |
    --java.awt.geom.Area
    |
    --RotatablePolygon
    All Implemented Interfaces:
    java.lang.Cloneable, java.awt.Shape
    public class RotatablePolygon
    extends java.awt.geom.Area
    Polygons which can be rotated around an `anchor' point and also translated (moved in the x and y directions).
    Constructor Summary
    RotatablePolygon(int[] xs, int[] ys, int n, double x, double y)
    Create a new RotatablePolyogon with given vertices and anchor point (x,y).
    Method Summary
    double getAngle()
    The current angle of rotation.
    double getXanchor()
    x-coordinate of the anchor point.
    double getYanchor()
    y-coordinate of the anchor point.
    void rotate(double da)
    Rotate the polygon from its current position by angle da (in radians) around the anchor.
    void rotateDegrees(double da)
    Rotate the polygon from its current position by angle da (in degrees) around the anchor.
    void setAngle(double a)
    Set the angle of rotation of the polygon to be angle a (in radians) around the anchor.
    void setAngleDegrees(double a)
    Set the angle of rotation of the polygon to be angle a (in degrees) around the anchor.
    void setPosition(double x, double y)
    Shift the polygon's position to put its anchor point at (x,y).
    void translate(double dx, double dy)
    Shift the polygon's position and anchor point by given amounts.
    Methods inherited from class java.awt.geom.Area
    add, clone, contains, contains, contains, contains, createTransformedArea, equals, exclusiveOr, getBounds, getBounds2D, getPathIterator, getPathIterator, intersect, intersects, intersects, isEmpty, isPolygonal, isRectangular, isSingular, reset, subtract, transform
    Methods inherited from class java.lang.Object
    equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    Constructor Detail
    RotatablePolygon
    public RotatablePolygon(int[] xs,
    int[] ys,
    int n,
    double x,
    double y)
    Create a new RotatablePolyogon with given vertices and anchor point (x,y).
    REQUIRE: xs.length >= n && ys.length >= n
    Parameters:
    xs - x-coordinates of vertices
    ys - y-coordinates of vertices
    n - number of vertices
    x - x-coordinate of the rotation anchor
    y - y-coordinate of the rotation anchor
    Method Detail
    setPosition
    public void setPosition(double x,
    double y)
    Shift the polygon's position to put its anchor point at (x,y).
    Parameters:
    x - new x-coordinate for anchor point
    y - new y-coordinate for anchor point
    translate
    public void translate(double dx,
    double dy)
    Shift the polygon's position and anchor point by given amounts.
    Parameters:
    dx - amount to shift by in x-direction
    dy - amount to shift by in y-direction
    setAngle
    public void setAngle(double a)
    Set the angle of rotation of the polygon to be angle a (in radians) around the anchor.
    Parameters:
    a - angle to rotate to, in radians
    setAngleDegrees
    public void setAngleDegrees(double a)
    Set the angle of rotation of the polygon to be angle a (in degrees) around the anchor.
    Parameters:
    a - angle to rotate to, in degrees
    rotate
    public void rotate(double da)
    Rotate the polygon from its current position by angle da (in radians) around the anchor.
    Parameters:
    da - angle to rotate by, in radians
    rotateDegrees
    public void rotateDegrees(double da)
    Rotate the polygon from its current position by angle da (in degrees) around the anchor.
    Parameters:
    da - angle to rotate by, in degrees
    getAngle
    public double getAngle()
    The current angle of rotation.
    getXanchor
    public double getXanchor()
    x-coordinate of the anchor point.
    getYanchor
    public double getYanchor()
    y-coordinate of the anchor point.

  • Please Help with Physics Project Here are the codings

    I've got three(3) classes a Model, a view, and a controller.
    This is a project about projectiles.it is an animation of a cannonball being fired from a cannon and travelling under the effect of gravity.A cannon fired at angle 'a' to the horizontal and with an initial speed 's', will have an initial velocity given by:
    vx := s * cos(a);//velocity x equals the speed multiply by the cosine of angle a.
    vy := s * sin(a);//velocity y equals the speed multiply by the sine of angle a.
    Here are the code.
    Model:
    /** Cannon specifies the expected behaviour of a cannon*/
    public class Cannon{
    public static final int TICK = 60;
    private int velocity = 0;
    private static final double gravity = .098f;
    private double angle = 0;
    // distances & positions are meausred in pixels
    private int x_pos; // ball's center x-position
    private int y_pos; // ball's center y-position
    // speed is measured in pixels per `tick'
    private int x_velocity; // horizonal speed; positive is to the right
    private int y_velocity; // vertical speed; positive is downwards
    public Cannon() {
    velocity = 3;
    angle = 60;
    angle = radians(angle);
    x_pos = 0;
    y_pos = 385;
    /** shoot fires a shot from the cannon*/
    public void shoot(){
    move();
    /**reload reloads the cannon with more shorts*/
    public void reload() {
    /** changeAngle changes the angle of the canon
    * @params value - the amount to add or subtract from the current angle value*/
    public void changeAngle(double value) {
    angle = (double)value;
    angle = radians(angle);
    /** getAngle returns the current angle value of the cannon*/
    public double getAngle() {
    return angle;
    /** changeVelocity changes the speed at which a cannon ball that is to be fire will travel at
    * @params value - the new speed at which the user wants a cannon ball to travel at.*/
    public void changeVelocityX(int value){
    x_velocity = x_velocity * (int)Math.cos(value);
    public void changeVelocityY(int value){
    y_velocity = y_velocity * (int)Math.sin(value);
    /** getVelocity returns the current velocity value of the cannon*/
    public int getVelocityX() {
    return x_velocity;
    public int getVelocityY() {
    return y_velocity;
    /** getGravity returns the current gravity value of the cannon*/
    public double getGravity() {
    return gravity;
    public int xPosition(){
    return x_pos;
    public int yPosition(){
    return y_pos;
    public void move(){
    double dx = getVelocityX() * Math.cos(getAngle());
    double dy = getVelocityY() * Math.sin(getAngle());
    x_pos+=dx;
    y_pos-=dy;
    double radians (double angle){
    return ((Math.PI * angle) / 180.0);
    View:
    import java.awt.*;
    import javax.swing.*;
    /** CannonView displays a cannon being fired.*/
    public class CannonView extends JPanel{
    /** DISPLAY_SIZE specifies the overall display area of the cannon and the bucket.*/
    public static final int DISPLAY_AREA_SIZE = 600;
    public RotatablePolygon rectangle;
    public RotatablePolygon triangle;
    public Cannon cannon;
    public CannonView(Cannon c) {
    this.setPreferredSize(new Dimension(600,450));
    this.setBackground(Color.black);
    cannon = c;
    int xRectangle[] = {0,0,40,40,0};
    int yRectangle[] = {400,300,300,400,400};
    int xTriangle[] = {0,20,40,0};
    int yTriangle[] = {300,280,300,300};
    rectangle = new RotatablePolygon (xRectangle, yRectangle, 5,20,350);
    // rectangle.setPosition (100, 100);
    // triangle = new RotatablePolygon (xTriangle, yTriangle, 4,0,290);
    triangle = new RotatablePolygon (xTriangle, yTriangle, 4,20,350);
    //triangle.setPosition (100, 100);
    JFrame frame = new JFrame();
    frame.getContentPane().add(this);
    frame.pack();
    frame.setVisible(true);
    frame.setTitle("Width = " + frame.getWidth() + " , Height = " + frame.getHeight());
    /** drawBucket draws a bucket/target for which a moving cannon ball should hit.
    * @param g - the graphics pen for which the drawing should occur.*/
    public void drawBucket(Graphics g) {
    g.setColor(Color.red);
    int xvalues[] = {495, 519, 575, 595, 495};
    int yvalues[] = {340, 400, 400, 340, 340};
    Polygon poly1 = new Polygon (xvalues, yvalues, 5);
    g.fillPolygon(poly1);
    g.setColor(Color.white);
    g.fillOval(495, 328, 100, 24);
    Graphics2D g2d = (Graphics2D)g;
    g2d.setStroke(new BasicStroke(2));
    g.setColor(Color.red);
    g.drawOval(495, 328, 100, 24);
    g.drawOval(495,311,100,54);
    /** drawCannon draws a cannon
    * @param g - the graphics pen that will be used to draw the cannon.*/
    public void drawCannon(Graphics g) {
    Graphics2D g2 = (Graphics2D)g;
    g.setColor(Color.red);
    g2.fill(rectangle);
    g.setColor(Color.orange);
    g2.fill(triangle);
    g.setColor(Color.blue);
    g.fillOval(95, 340, 60, 60);
    g.setColor(Color.magenta);
    for (int i = 0; i < 6; i++){
    g.fillArc(95, 340, 60, 60, i* 60, 30);
    g.setColor(Color.black);
    g.fillOval(117, 362, 16, 16);
    /** drawCannonShots will draw the actual number of shots already used by the cannon
    * @param g - the graphics pen that will be used to draw the shots of the cannon.*/
    public void drawCannonShots(Graphics g) {
    g.setColor(Color.orange);
    g.fillOval(cannon.xPosition(),cannon.yPosition(),16,16);
    /** drawTrail will draw a trail of smoke to indicate where a cannon ball has passed
    * @param g - the graphics pen used to draw the trail.*/
    public void drawTrail(Graphics g){}
    /**drawGround draws the ground for which the cannon sits*/
    public void drawGround(Graphics g) {
    g.setColor(Color.green.brighter());
    g.fillRect(0,400,600,50);
    /** drawMovingCannonBall draw a cannon ball moving at a certain speed (velocity),
    * with a certain amount of gravitational acting upon it, at a certain angle.
    * @params g - the graphics pen used to draw the moving cannon ball.
    * @params gravity - the value of gravity.
    * @params velocity - the speed at which the ball is travelling.
    * @params angle - the angle at which the ball was shot from.*/
    public void drawMovingCannonBall(Graphics g, double gravity, double velocity, double angle){}
    /** paintComponent paints the cannon,bucket
    * @param g - graphics pen.*/
    public void paintComponent(Graphics g) {
    super.paintComponent(g);
    drawGround(g);
    drawBucket(g);
    drawCannon(g);
    drawCannonShots(g);
    Controller
    /** CannonController controls the interaction between the user and a cannon*/
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.event.*;
    public class CannonController extends JFrame{
    public JMenuBar jMenuBar2;
    public JMenu jMenu2;
    public JMenuItem jMenuItem1;
    public JMenu jMenu3;
    public JMenuItem jMenuItem2;
    public JLabel angleLabel, velocityLabel;
    public JTextField angleTextField, velocityTextField;
    public JButton fireButton, reloadButton;
    public JSlider angleSlider, velocitySlider;
    private CannonView view;
    private Cannon cannon;
    int oldValue, newValue;
    public CannonController(Cannon acannon) {
    cannon = acannon;
    view = new CannonView(cannon);
    loadControls();
    angleTextField.setText(String.valueOf(angleSlider.getValue()));
    oldValue = angleSlider.getValue();
    newValue = oldValue + 1;
    velocityTextField.setText(String.valueOf(velocitySlider.getValue()));
    this.setSize(328,308);
    this.setLocation(view.getWidth()-this.getWidth(),0);
    /** loadControl loads all of the GUI controls that a
    * user of the cannon animation will use to interact with the program*/
    public void loadControls() {
    jMenuBar2 = new JMenuBar();
    jMenu2 = new JMenu();
    jMenuItem1 = new JMenuItem();
    jMenu3 = new JMenu();
    jMenuItem2 = new JMenuItem();
    angleLabel = new JLabel();
    velocityLabel = new JLabel();
    angleTextField = new JTextField();
    velocityTextField = new JTextField();
    fireButton = new JButton();
    reloadButton = new JButton();
    angleSlider = new JSlider();
    velocitySlider = new JSlider();
    jMenuBar2.setBorderPainted(false);
    jMenu2.setModel(jMenu2.getModel());
    jMenu2.setText("File");
    jMenuItem1.setText("Exit");
    jMenuItem1.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent evt) {
    jMenuItem1ActionPerformed(evt);
    jMenu2.add(jMenuItem1);
    jMenuBar2.add(jMenu2);
    jMenu3.setText("Help");
    jMenuItem2.setText("About this Program");
    jMenuItem2.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent evt) {
    jMenuItem2ActionPerformed(evt);
    jMenu3.add(jMenuItem2);
    jMenuBar2.add(jMenu3);
    getContentPane().setLayout(null);
    setTitle("Cannon Controller Form");
    setResizable(false);
    setMenuBar(getMenuBar());
    addWindowListener(new WindowAdapter() {
    public void windowClosing(WindowEvent evt) {
    exitForm(evt);
    angleLabel.setText("Angle:");
    getContentPane().add(angleLabel);
    angleLabel.setLocation(10, 20);
    angleLabel.setSize(angleLabel.getPreferredSize());
    velocityLabel.setText("Velocity:");
    getContentPane().add(velocityLabel);
    velocityLabel.setLocation(10, 80);
    velocityLabel.setSize(velocityLabel.getPreferredSize());
    angleTextField.setToolTipText("Only numeric values are allow");
    getContentPane().add(angleTextField);
    angleTextField.setBounds(280, 20, 30, 20);
    velocityTextField.setToolTipText("Only numeric values are allow");
    getContentPane().add(velocityTextField);
    velocityTextField.setBounds(280, 80, 30, 20);
    fireButton.setToolTipText("Click to fire a shot");
    fireButton.setText("Fire");
    fireButton.addMouseListener(new MouseAdapter() {
    public void mouseClicked(MouseEvent evt) {
    fireButtonMouseClicked(evt);
    getContentPane().add(fireButton);
    fireButton.setBounds(60, 160, 80, 30);
    reloadButton.setToolTipText("Click to reload cannon");
    reloadButton.setText("Reload");
    reloadButton.addMouseListener(new MouseAdapter() {
    public void mouseClicked(MouseEvent evt) {
    reloadButtonMouseClicked(evt);
    getContentPane().add(reloadButton);
    reloadButton.setBounds(150, 160, 80, 30);
    angleSlider.setMinorTickSpacing(30);
    angleSlider.setPaintLabels(true);
    angleSlider.setPaintTicks(true);
    angleSlider.setMinimum(0);
    angleSlider.setMajorTickSpacing(60);
    angleSlider.setToolTipText("Change the cannon angle");
    angleSlider.setMaximum(360);
    angleSlider.setValue(0);
    angleSlider.addChangeListener(new ChangeListener() {
    public void stateChanged(ChangeEvent evt) {
    angleSliderStateChanged(evt);
    getContentPane().add(angleSlider);
    angleSlider.setBounds(60, 20, 210, 40);
    velocitySlider.setMinorTickSpacing(5);
    velocitySlider.setPaintLabels(true);
    velocitySlider.setPaintTicks(true);
    velocitySlider.setMinimum(1);
    velocitySlider.setMajorTickSpacing(10);
    velocitySlider.setToolTipText("Change the speed of the cannon ball");
    velocitySlider.setMaximum(28);
    velocitySlider.setValue(3);
    velocitySlider.addChangeListener(new ChangeListener() {
    public void stateChanged(ChangeEvent evt) {
    velocitySliderStateChanged(evt);
    getContentPane().add(velocitySlider);
    velocitySlider.setBounds(60, 80, 210, 50);
    setJMenuBar(jMenuBar2);
    pack();
    private void reloadButtonMouseClicked(MouseEvent evt) {
    reloadButtonClick();
    private void fireButtonMouseClicked(MouseEvent evt) {
    fireButtonClick();
    /** firstButtonClick is the event handler that sends a message
    * to the cannon class to invokes the cannon's fire method*/
    public void fireButtonClick() {
    // JOptionPane.showMessageDialog(null,"You click Fire");
    cannon.shoot();
    view.repaint();
    /** reloadButtonClick is the event handler that sends a message
    * to the cannon class to invokes the cannon's reload method*/
    public void reloadButtonClick() {
    JOptionPane.showMessageDialog(null,"reload");
    private void angleSliderStateChanged(ChangeEvent evt) {
    angleTextField.setText(String.valueOf(angleSlider.getValue()));
    view.rectangle.setAngle(angleSlider.getValue() * (Math.PI / 180));
    view.triangle.setAngle(angleSlider.getValue() * (Math.PI / 180));
    cannon.changeAngle(angleSlider.getValue());
    view.repaint();
    private void velocitySliderStateChanged(ChangeEvent evt) {
    velocityTextField.setText(String.valueOf(velocitySlider.getValue()));
    cannon.changeVelocityX(velocitySlider.getValue());
    private void gravitySliderStateChanged(ChangeEvent evt) {
    private void jMenuItem1ActionPerformed(ActionEvent evt) {
    System.exit (0);
    private void jMenuItem2ActionPerformed(ActionEvent evt) {
    String message = "Cannon Animation\n"+
    "Based on the Logic of Projectiles";
    JOptionPane.showMessageDialog(null,message,"About this program",JOptionPane.PLAIN_MESSAGE);
    /** Exit the Application */
    private void exitForm(WindowEvent evt) {
    System.exit (0);
    /** Pause execution for t milliseconds. */
    private void delay (int t) {
    try {
    Thread.sleep (t);
    } catch (InterruptedException e) {}
    public static void main(String [] args){
    Cannon cn = new Cannon();
    CannonController control = new CannonController(cn);
    control.setTitle("Test");
    control.setVisible(true);
    if the cannon ball land in the bucket it should stop and the animation should indicate a 'hit' in some way. maybe by displaying a message.
    if the cannonball hits the outside of the bucket it should bounce off.
    Extra Notes.
    1) The acceleration due to gravity is 9.8m/s to the (power of (2) eg s2.
    2) The distance travelled in time t by a body with initial velocity v under constant acceleration a is:
    v * t + a * t.pow(2) div 2;
    The velocity at the end of time t will be v + a * t.
    Distance is measure in pixels rather than meter so for simplicity we use 1 pixel per meter
    When i pressed the fire button nothings happens. I'm going crazy. Please please help!

    Hi,
    U put something on forum and keeping silence.If it is not necessary dont put in forum.I moved your cannon ball.If u want continous movement I need some more information.
    Johnson

Maybe you are looking for