Need help with crazy custom calculations code in Acrobat XI pro

Im trying to calculate some text feilds together and just cant figure it out.  I have two text feild boxes that I would input certain numbers to calculate in, Textfeild D5 and D6,  once the user supplies the numbers in the D5 and D6   I need a text feild (D9) to calculate and produce a number thats used in another calculation. Any help would be greatly appriciated. Im good at HTML and CSS but only begining with javascript. Im using acrobat XI pro and I put this code in the custom javascript area within the text feld "D9" properties.
var Dsix = +getField("D6").value;
var Dfive = +getFeild("D5").value;
var B2 = 0.37;
var B3 = 0.45;
var B4 = 0.53;
if (Dsix = 15){
D9.value = B2*Dfive;
if (Dsix = 30){
D9.value = B3*Dfive;
if (Dsix = 45){
D9.value = B4*Dfive;

Well thats makes since but unfortunitly it didnt work. The green text feild D9 is where im placing code at. they will be hiiden feilds. the red outlined text feilds are all input feilds. seconds is D6 and nozzels is D5.

Similar Messages

  • Need help with my graphic calculator!!!

    Hello everybody!! I need help with my little program I made.... The problem is that I am unable to use to calculate but it is possible to compile the code!! What should I do?? Thanks in advance.
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    class Aritmetik extends JFrame implements ActionListener{
         private JLabel l1 = new JLabel("Tal1: ", JLabel.LEFT);
         private JLabel l2 = new JLabel("Tal2: ", JLabel.LEFT);
         private JLabel l3 = new JLabel("Resultat",JLabel.LEFT);
         private JLabel l4 = new JLabel(" ", JLabel.RIGHT);
         private JTextField t1 = new JTextField(" ",10);
         private JTextField t2 = new JTextField(" ",10);
         private JButton b1 = new JButton("+");
         private JButton b2 = new JButton("-");
         private JButton b3 = new JButton("*");
         private JButton b4 = new JButton("/");
         public Aritmetik(){
              Container v = getContentPane();
              v.setLayout(new GridLayout(5,2));
              v.add(l1);
              v.add(t1);
              v.add(l2);
              v.add(t2);
              v.add(b1);
              v.add(b2);
              v.add(b3);
              v.add(b4);
              v.add(l3);
              v.add(l4);
              b1.addActionListener(this);
              b2.addActionListener(this);
              b3.addActionListener(this);
              b4.addActionListener(this);
              pack();
              setVisible(true);
              setDefaultCloseOperation(EXIT_ON_CLOSE);
         public void actionPerformed(ActionEvent e){
              int tal1 = Integer.parseInt(t1.getText());
              int tal2 = Integer.parseInt(t2.getText());
                   if(e.getSource() == b1){
              if(t1.getText().equals("") || t2.getText().equals(""))
                                       JOptionPane.showMessageDialog(null, "Mata in tal!");
                   else{
                        l3.setText("Resultat ");
                   l4.setText(" " + (tal1+tal2));
                   else if(e.getSource() == b2){
                        int sub = tal1-tal2;
                        l4.setText(" " + (sub));
                   else if(e.getSource() == b3){
                        int multi = tal1*tal2;
                        l4.setText(" " + (multi));
                   else if(e.getSource() == b4){
                        int div = tal1/tal2;
                        l4.setText(" " + (div));
                   public static void main(String[] arg){
                   Aritmetik A =new Aritmetik();

    Here is your problem:
    public void actionPerformed(ActionEvent e){
      int tal1 = Integer.parseInt(t1.getText().trim());  // add the trim()
      int tal2 = Integer.parseInt(t2.getText().trim());  // add the trim()
      if(e.getSource() == b1){
        if(t1.getText().equals("") || t2.getText().equals(""))
          JOptionPane.showMessageDialog(null, "Mata in tal!");
        else{
          l3.setText("Resultat ");
          l4.setText(" " + (tal1+tal2));
      }... Better ...
    public void actionPerformed(ActionEvent e)  throws NumberFormatException {
      String tala = t1.getText().trim();
      String talb = t2.getText().trim();
      if ( tala == null  ||  "".equals(tala)  ||  talb == null  ||  "".equals(talb) ) {
        JOptionPane.showMessageDialog(null, "Mata in tal!");
        return();
      int tal1 = Integer.parseInt(tala);
      int tal2 = Integer.parseInt(talb);
      if(e.getSource() == b1){
        l3.setText("Resultat ");
        l4.setText(" " + (tal1+tal2));
      else if(e.getSource() == b2){
        int sub = tal1-tal2;
        l4.setText(" " + (sub));
      else if(e.getSource() == b3){
        int multi = tal1*tal2;
        l4.setText(" " + (multi));
      else if(e.getSource() == b4){
        int div = tal1/tal2;
        l4.setText(" " + (div));
    }Message was edited by:
    abillconsl

  • [8i] Need help with some workday calculations

    At the beginning of the month, I got help with a workday calculation in: [8i] Help with function with parameters (for workday calculation)
    Now, as it turns out, I was able to locate a function in the database that does what I want, however, it is much slower to use the function than to join two copies of the CALN table (Please see referenced thread for details. I can copy them to this thread if necessary.) I need to verify that the pre-existing function has 'DETERMINISTIC' in it, as I would guess that if it doesn't, it would be much slower than it could be.
    But now, I've come across a situation where I have to do multiple workday calculations in the same query--enough that I have to join 6 copies of my CALN table. I can't imagine that is at all efficient. I believe it was Frank K. who said (in the original thread) that if the function was slow, I should consider alternatives. Can anyone help me identify some of those alternatives? I'm definitely at that point now. (This query is one I'm using as the base for a report in Oracle BI, and let's just say it doesn't like my query, even though my syntax appears to be correct, and I would guess that joining 6 copies of one table is at least partly to blame for this).
    Note: I'm working with Oracle 8i

    OK, I finally have some sample data... I tried to make it thorough. I've included data in the CALN table YTD + tomorrow, so that any workday calculations using SYSDATE will work.
    CREATE TABLE caln
    (     clndr_dt     DATE          NOT NULL
    ,     clndr_yr     NUMBER
    ,     shop_day     NUMBER
    ,     shop_dt          DATE
    ,     shop_wk          NUMBER
    ,     shop_yr          NUMBER
    ,     shop_days     NUMBER
    ,     clndr_days     NUMBER
         CONSTRAINT caln_pk PRIMARY KEY (clndr_dt)
    INSERT INTO     caln
    VALUES (To_Date('12/23/2009','mm/dd/yyyy'),2009,247,To_Date('12/23/2009','mm/dd/yyyy'),51,2009,7631,10950);
    INSERT INTO     caln
    VALUES (To_Date('01/01/2010','mm/dd/yyyy'),2010,0,To_Date('12/23/2009','mm/dd/yyyy'),52,2009,7631,10959);
    INSERT INTO     caln
    VALUES (To_Date('01/02/2010','mm/dd/yyyy'),2010,0,To_Date('12/23/2009','mm/dd/yyyy'),52,2009,7631,10960);
    INSERT INTO     caln
    VALUES (To_Date('01/03/2010','mm/dd/yyyy'),2010,0,To_Date('12/23/2009','mm/dd/yyyy'),1,2010,7631,10961);
    INSERT INTO     caln
    VALUES (To_Date('01/04/2010','mm/dd/yyyy'),2010,1,To_Date('01/04/2010','mm/dd/yyyy'),1,2010,7632,10962);
    INSERT INTO     caln
    VALUES (To_Date('01/05/2010','mm/dd/yyyy'),2010,2,To_Date('01/05/2010','mm/dd/yyyy'),1,2010,7633,10963);
    INSERT INTO     caln
    VALUES (To_Date('01/06/2010','mm/dd/yyyy'),2010,3,To_Date('01/06/2010','mm/dd/yyyy'),1,2010,7634,10964);
    INSERT INTO     caln
    VALUES (To_Date('01/07/2010','mm/dd/yyyy'),2010,4,To_Date('01/07/2010','mm/dd/yyyy'),1,2010,7635,10965);
    INSERT INTO     caln
    VALUES (To_Date('01/08/2010','mm/dd/yyyy'),2010,5,To_Date('01/08/2010','mm/dd/yyyy'),1,2010,7636,10966);
    INSERT INTO     caln
    VALUES (To_Date('01/09/2010','mm/dd/yyyy'),2010,0,To_Date('01/08/2010','mm/dd/yyyy'),1,2010,7636,10967);
    INSERT INTO     caln
    VALUES (To_Date('01/10/2010','mm/dd/yyyy'),2010,0,To_Date('01/08/2010','mm/dd/yyyy'),2,2010,7636,10968);
    INSERT INTO     caln
    VALUES (To_Date('01/11/2010','mm/dd/yyyy'),2010,6,To_Date('01/11/2010','mm/dd/yyyy'),2,2010,7637,10969);
    INSERT INTO     caln
    VALUES (To_Date('01/12/2010','mm/dd/yyyy'),2010,7,To_Date('01/12/2010','mm/dd/yyyy'),2,2010,7638,10970);
    INSERT INTO     caln
    VALUES (To_Date('01/13/2010','mm/dd/yyyy'),2010,8,To_Date('01/13/2010','mm/dd/yyyy'),2,2010,7639,10971);
    INSERT INTO     caln
    VALUES (To_Date('01/14/2010','mm/dd/yyyy'),2010,9,To_Date('01/14/2010','mm/dd/yyyy'),2,2010,7640,10972);
    INSERT INTO     caln
    VALUES (To_Date('01/15/2010','mm/dd/yyyy'),2010,10,To_Date('01/15/2010','mm/dd/yyyy'),2,2010,7641,10973);
    INSERT INTO     caln
    VALUES (To_Date('01/16/2010','mm/dd/yyyy'),2010,0,To_Date('01/15/2010','mm/dd/yyyy'),2,2010,7641,10974);
    INSERT INTO     caln
    VALUES (To_Date('01/17/2010','mm/dd/yyyy'),2010,0,To_Date('01/15/2010','mm/dd/yyyy'),3,2010,7641,10975);
    INSERT INTO     caln
    VALUES (To_Date('01/18/2010','mm/dd/yyyy'),2010,11,To_Date('01/18/2010','mm/dd/yyyy'),3,2010,7642,10976);
    INSERT INTO     caln
    VALUES (To_Date('01/19/2010','mm/dd/yyyy'),2010,12,To_Date('01/19/2010','mm/dd/yyyy'),3,2010,7643,10977);
    INSERT INTO     caln
    VALUES (To_Date('01/20/2010','mm/dd/yyyy'),2010,13,To_Date('01/20/2010','mm/dd/yyyy'),3,2010,7644,10978);
    INSERT INTO     caln
    VALUES (To_Date('01/21/2010','mm/dd/yyyy'),2010,14,To_Date('01/21/2010','mm/dd/yyyy'),3,2010,7645,10979);
    INSERT INTO     caln
    VALUES (To_Date('01/22/2010','mm/dd/yyyy'),2010,15,To_Date('01/22/2010','mm/dd/yyyy'),3,2010,7646,10980);
    INSERT INTO     caln
    VALUES (To_Date('01/23/2010','mm/dd/yyyy'),2010,0,To_Date('01/22/2010','mm/dd/yyyy'),3,2010,7646,10981);
    INSERT INTO     caln
    VALUES (To_Date('01/24/2010','mm/dd/yyyy'),2010,0,To_Date('01/22/2010','mm/dd/yyyy'),4,2010,7646,10982);
    INSERT INTO     caln
    VALUES (To_Date('01/25/2010','mm/dd/yyyy'),2010,16,To_Date('01/25/2010','mm/dd/yyyy'),4,2010,7647,10983);
    INSERT INTO     caln
    VALUES (To_Date('01/26/2010','mm/dd/yyyy'),2010,17,To_Date('01/26/2010','mm/dd/yyyy'),4,2010,7648,10984);
    INSERT INTO     caln
    VALUES (To_Date('01/27/2010','mm/dd/yyyy'),2010,18,To_Date('01/27/2010','mm/dd/yyyy'),4,2010,7649,10985);
    INSERT INTO     caln
    VALUES (To_Date('01/28/2010','mm/dd/yyyy'),2010,19,To_Date('01/28/2010','mm/dd/yyyy'),4,2010,7650,10986);
    INSERT INTO     caln
    VALUES (To_Date('01/29/2010','mm/dd/yyyy'),2010,20,To_Date('01/29/2010','mm/dd/yyyy'),4,2010,7651,10987);
    INSERT INTO     caln
    VALUES (To_Date('01/30/2010','mm/dd/yyyy'),2010,0,To_Date('01/29/2010','mm/dd/yyyy'),4,2010,7651,10988);
    INSERT INTO     caln
    VALUES (To_Date('01/31/2010','mm/dd/yyyy'),2010,0,To_Date('01/29/2010','mm/dd/yyyy'),5,2010,7651,10989);
    INSERT INTO     caln
    VALUES (To_Date('02/01/2010','mm/dd/yyyy'),2010,21,To_Date('02/01/2010','mm/dd/yyyy'),5,2010,7652,10990);
    INSERT INTO     caln
    VALUES (To_Date('02/02/2010','mm/dd/yyyy'),2010,22,To_Date('02/02/2010','mm/dd/yyyy'),5,2010,7653,10991);
    INSERT INTO     caln
    VALUES (To_Date('02/03/2010','mm/dd/yyyy'),2010,23,To_Date('02/03/2010','mm/dd/yyyy'),5,2010,7654,10992);
    INSERT INTO     caln
    VALUES (To_Date('02/04/2010','mm/dd/yyyy'),2010,24,To_Date('02/04/2010','mm/dd/yyyy'),5,2010,7655,10993);
    INSERT INTO     caln
    VALUES (To_Date('02/05/2010','mm/dd/yyyy'),2010,25,To_Date('02/05/2010','mm/dd/yyyy'),5,2010,7656,10994);
    INSERT INTO     caln
    VALUES (To_Date('02/06/2010','mm/dd/yyyy'),2010,0,To_Date('02/05/2010','mm/dd/yyyy'),5,2010,7656,10995);
    INSERT INTO     caln
    VALUES (To_Date('02/07/2010','mm/dd/yyyy'),2010,0,To_Date('02/05/2010','mm/dd/yyyy'),6,2010,7656,10996);
    INSERT INTO     caln
    VALUES (To_Date('02/08/2010','mm/dd/yyyy'),2010,26,To_Date('02/08/2010','mm/dd/yyyy'),6,2010,7657,10997);
    INSERT INTO     caln
    VALUES (To_Date('02/09/2010','mm/dd/yyyy'),2010,27,To_Date('02/09/2010','mm/dd/yyyy'),6,2010,7658,10998);
    INSERT INTO     caln
    VALUES (To_Date('02/10/2010','mm/dd/yyyy'),2010,28,To_Date('02/10/2010','mm/dd/yyyy'),6,2010,7659,10999);
    INSERT INTO     caln
    VALUES (To_Date('02/11/2010','mm/dd/yyyy'),2010,29,To_Date('02/11/2010','mm/dd/yyyy'),6,2010,7660,11000);
    INSERT INTO     caln
    VALUES (To_Date('02/12/2010','mm/dd/yyyy'),2010,30,To_Date('02/12/2010','mm/dd/yyyy'),6,2010,7661,11001);
    INSERT INTO     caln
    VALUES (To_Date('02/13/2010','mm/dd/yyyy'),2010,0,To_Date('02/12/2010','mm/dd/yyyy'),6,2010,7661,11002);
    INSERT INTO     caln
    VALUES (To_Date('02/14/2010','mm/dd/yyyy'),2010,0,To_Date('02/12/2010','mm/dd/yyyy'),7,2010,7661,11003);
    INSERT INTO     caln
    VALUES (To_Date('02/15/2010','mm/dd/yyyy'),2010,31,To_Date('02/15/2010','mm/dd/yyyy'),7,2010,7662,11004);
    INSERT INTO     caln
    VALUES (To_Date('02/16/2010','mm/dd/yyyy'),2010,32,To_Date('02/16/2010','mm/dd/yyyy'),7,2010,7663,11005);
    INSERT INTO     caln
    VALUES (To_Date('02/17/2010','mm/dd/yyyy'),2010,33,To_Date('02/17/2010','mm/dd/yyyy'),7,2010,7664,11006);
    INSERT INTO     caln
    VALUES (To_Date('02/18/2010','mm/dd/yyyy'),2010,34,To_Date('02/18/2010','mm/dd/yyyy'),7,2010,7665,11007);
    INSERT INTO     caln
    VALUES (To_Date('02/19/2010','mm/dd/yyyy'),2010,35,To_Date('02/19/2010','mm/dd/yyyy'),7,2010,7666,11008);
    INSERT INTO     caln
    VALUES (To_Date('02/20/2010','mm/dd/yyyy'),2010,0,To_Date('02/19/2010','mm/dd/yyyy'),7,2010,7666,11009);
    CREATE TABLE ords
    (     ord_nbr          NUMBER          NOT NULL
    ,     sub_nbr          NUMBER          NOT NULL
    ,     ord_stat     VARCHAR2(2)
    ,     ord_qty          NUMBER
    ,     part_nbr     VARCHAR2(5)
         CONSTRAINT ords_pk PRIMARY KEY (ord_nbr, sub_nbr)
    INSERT INTO     ords
    VALUES (1,1,'CL',10,'PART1');
    INSERT INTO     ords
    VALUES (1,2,'CL',5,'PART1');
    INSERT INTO     ords
    VALUES (25,1,'CL',15,'PART2');
    INSERT INTO     ords
    VALUES (14,1,'OP',12,'PART3');
    INSERT INTO     ords
    VALUES (33,1,'CL',25,'PART1');
    INSERT INTO     ords
    VALUES (33,2,'CL',15,'PART1');
    INSERT INTO     ords
    VALUES (33,3,'OP',10,'PART1');
    INSERT INTO     ords
    VALUES (7,1,'PL',18,'PART2');
    INSERT INTO     ords
    VALUES (96,1,'PL',10,'PART3');
    INSERT INTO     ords
    VALUES (31,1,'CL',20,'PART2');
    CREATE TABLE oops
    (     ord_nbr          NUMBER          NOT NULL
    ,     sub_nbr          NUMBER          NOT NULL
    ,     op_nbr          VARCHAR2(4)     NOT NULL
    ,     mach_id          VARCHAR2(4)
    ,     oper_stat     VARCHAR2(2)
    ,     plan_start_dt     DATE
    ,     plsu          NUMBER
    ,     plrn          NUMBER
         CONSTRAINT ords_pk PRIMARY KEY (ord_nbr, sub_nbr, op_nbr)
    -- NOTE:
    -- for the orders with a status of 'CL' or 'PL' in the 'ords' table, I'm not bothering to put
    -- in more than two operations (though in reality more would be there) since they should be
    -- ignored in the final result anyway
    INSERT INTO     oops
    VALUES (1,1,'0010','123A','CL',TO_DATE('01/11/2010','mm/dd/yyyy'),2,0.2);
    INSERT INTO     oops
    VALUES (1,1,'0015','259B','CP',TO_DATE('01/12/2010','mm/dd/yyyy'),1,0.15);
    INSERT INTO     oops
    VALUES (1,2,'0010','123A','CP',TO_DATE('01/11/2010','mm/dd/yyyy'),2,0.2);
    INSERT INTO     oops
    VALUES (1,2,'0015','259B','CP',TO_DATE('01/12/2010','mm/dd/yyyy'),1,0.15);
    INSERT INTO     oops
    VALUES (25,1,'0005','123A','CP',TO_DATE('01/18/2010','mm/dd/yyyy'),2,0.25);
    INSERT INTO     oops
    VALUES (25,1,'0030','110C','CL',TO_DATE('01/19/2010','mm/dd/yyyy'),4,0.1);
    INSERT INTO     oops
    VALUES (14,1,'0010','127A','CP',TO_DATE('01/11/2010','mm/dd/yyyy'),2,0.25);
    INSERT INTO     oops
    VALUES (14,1,'0025','110C','CL',TO_DATE('01/12/2010','mm/dd/yyyy'),1,0.1);
    INSERT INTO     oops
    VALUES (14,1,'0040','050C','CP',TO_DATE('01/13/2010','mm/dd/yyyy'),1.3,0.15);
    INSERT INTO     oops
    VALUES (14,1,'0050','220B','WK',TO_DATE('01/14/2010','mm/dd/yyyy'),4,0.25);
    INSERT INTO     oops
    VALUES (14,1,'0065','242B','AV',TO_DATE('01/18/2010','mm/dd/yyyy'),1.5,0.1);
    INSERT INTO     oops
    VALUES (14,1,'0067','150G','NA',TO_DATE('01/19/2010','mm/dd/yyyy'),2,0.1);
    INSERT INTO     oops
    VALUES (14,1,'0100','250G','NA',TO_DATE('01/20/2010','mm/dd/yyyy'),2.1,0.2);
    INSERT INTO     oops
    VALUES (33,1,'0010','123A','CL',TO_DATE('01/11/2010','mm/dd/yyyy'),1.9,0.2);
    INSERT INTO     oops
    VALUES (33,1,'0015','259B','CP',TO_DATE('01/12/2010','mm/dd/yyyy'),1,0.1);
    INSERT INTO     oops
    VALUES (33,2,'0010','123A','CL',TO_DATE('01/11/2010','mm/dd/yyyy'),1.9,0.2);
    INSERT INTO     oops
    VALUES (33,2,'0015','259B','CP',TO_DATE('01/12/2010','mm/dd/yyyy'),1,0.1);
    INSERT INTO     oops
    VALUES (33,3,'0010','123A','CL',TO_DATE('01/11/2010','mm/dd/yyyy'),1.9,0.2);
    INSERT INTO     oops
    VALUES (33,3,'0015','259B','CP',TO_DATE('01/12/2010','mm/dd/yyyy'),1,0.1);
    INSERT INTO     oops
    VALUES (33,3,'0020','220B','NA',TO_DATE('01/12/2010','mm/dd/yyyy'),1.7,0.15);
    INSERT INTO     oops
    VALUES (33,3,'0030','150G','NA',TO_DATE('01/13/2010','mm/dd/yyyy'),1.3,0.05);
    INSERT INTO     oops
    VALUES (33,3,'0055','150G','NA',TO_DATE('01/15/2010','mm/dd/yyyy'),2.1.,0.1);
    INSERT INTO     oops
    VALUES (7,1,'0005','123A','NA',TO_DATE('01/11/2010','mm/dd/yyyy'),2,0.2);
    INSERT INTO     oops
    VALUES (7,1,'0030','110C','NA',TO_DATE('01/12/2010','mm/dd/yyyy'),1,0.15);
    INSERT INTO     oops
    VALUES (96,1,'0010','127A','NA',TO_DATE('01/11/2010','mm/dd/yyyy'),2,0.25);
    INSERT INTO     oops
    VALUES (96,1,'0025','110C','NA',TO_DATE('01/12/2010','mm/dd/yyyy'),1,0.1);
    INSERT INTO     oops
    VALUES (31,1,'0005','123A','CL',TO_DATE('01/11/2010','mm/dd/yyyy'),1.9,0.2);
    INSERT INTO     oops
    VALUES (31,1,'0030','110C','CP',TO_DATE('01/12/2010','mm/dd/yyyy'),1,0.1);
    CREATE TABLE mach
    (     mach_id          VARCHAR2(4)     NOT NULL
    ,     desc_short     VARCHAR2(9)     
    ,     group          VARCHAR2(7)
         CONSTRAINT ords_pk PRIMARY KEY (mach_id)
    INSERT INTO     mach
    VALUES     ('123A','desc here','GROUPH1');
    INSERT INTO     mach
    VALUES     ('259B','desc here','GROUPH2');
    INSERT INTO     mach
    VALUES     ('110C','desc here','GROUPJ1');
    INSERT INTO     mach
    VALUES     ('050C','desc here','GROUPK2');
    INSERT INTO     mach
    VALUES     ('220B','desc here','GROUPH2');
    INSERT INTO     mach
    VALUES     ('242B','desc here','GROUPH2');
    INSERT INTO     mach
    VALUES     ('150G','desc here','GROUPL1');
    INSERT INTO     mach
    VALUES     ('250G','desc here','GROUPL2');
    INSERT INTO     mach
    VALUES     ('242B','desc here','GROUPH2');

  • Need help with my iTunes on iPhone 5 and Macbook Pro

    Need help with my iPhone 5 and my Macbook Pro.  I was purchased some music on itunes at my mac. Some reason I deleted those music from both on Mac and iPhone 5.  Today, I went to my iPhone iTunes store inside of iCloud to redownload my puchased. But those song won't able to sync back to my iTunes library on my Mac.  Can anyone help me with that ??....

    You've posted to the iTunes Match forum, which your question does not appear to be related to. You'll get better support responses by posting to either the iTunes for Mac or iTunes for Windows forum. Which ever is more appropriate for your situation.

  • Need help with a customized interactive web application for  apparel

    Help!!!!
    Hi I am a web designer at beginners stage with web
    devlopment. I am seeking guidance on how to develop a customized
    interactive web application so that the end user can change color
    and patterns of apparel on vector images such as teamsports
    uniforms and tshirts. Once the design is customized to their liking
    they can save it with all of the spec information in a file to
    there desktop or to a database to send to the manufacturer.
    Also looking for a possible way to use a CMS so I can upload
    templates of the garment easily for the end user to customize
    online. Can this be done and if so how? This is an example the kind
    of application I am looking for:
    http://www.dynamicteamsports.com/elite/placeorder.jsp
    I am in desperate need of some brilliant developer to help
    with this.
    Thanks in advance for anyone who is willing to assist or give
    me guidance,
    Danka
    "Reap what you sew"

    some parts of that are doable using non-advanced skills, but
    will be difficult and unwieldly if there are more than a few
    colors/patterns.
    saving the image to the server is a bit more advanced and
    you're going to need some server-side scripting like php, perl, asp
    etc. in addition to some flash programming ability.

  • Need help with this Pascal Triangle code....

    Hey everyonr i am totally new to Java... so need your help with this code...
    the function makeRows gives me problems... main is correct ... can someone fix my makeRows... i don't see what's wrong
    public class Pascal {
      /** Return ragged array containing the first nRows rows of Pascal's
       *  triangle.
      public static int[][] makeRows(int nRows) {
            int[][] mpr  = new int[nRows+1][];
            int l=0; int r=0;
            for (int row = 0; row < nRows; row++) {
              mpr[row] = new int[row+1];  //index starts at 0
              if (row==0) {
                mpr[0][0]= 1;
                    if (row==1) {
                mpr[1][0]= 1;
                mpr[1][1]= 1;
              if (row>=2) {
                 for (int j = 0; j <= row; j++) {
                    if (j==0)               {l=0;} else {l=mpr[row-1][j-1];}
                    if (j==mpr[row].length-1) {r=0;} else{r=mpr[row-1][j];}
                    mpr[row][j] = l + r;
            return mpr;
      public static void main(String[] args) {
             if (args.length != 1) {
               System.out.println("usage: java " + Pascal.class.getName() + " N_ROWS");
               System.exit(1);
             int nRows = Integer.parseInt(args[0]);
             if (nRows > 0) {
               int[][] pascal = makeRows(nRows);
               for (int[] row : pascal) {
              for (int v : row) System.out.print(v + " ");
              System.out.println("");
         }this makeRows function should return ragged array containing the first nRows rows of Pascal's triangle
    thanks
    Edited by: magic101 on May 9, 2008 4:03 PM

    magic,
    i think corlettk meant that some people might not know what pascal's triangle is.
    also, you didnt say what was wrong with your code, just that it was wrong.
    asking smart questions is about giving as much information you can to get the
    best answer. i would throw a System.out.print between every line of your
    algorithm. i would also supply us with the values you are getting for each row.
    also, this question is asked all the time here. do a forum search.
    1
    11
    121
    1331
    14641

  • Need help with part of my code

    this code is taken from a News server i am making...
    // process connection with client
       private void processConnection(String[][] texts) throws IOException
         Newslist = new ArrayList();
         //output.getTexts;
        for (int i = 0; i < texts.length; i++) {
                System.out.println(texts[0]+ "" + texts[i][1]+ "" +texts[i][2] );
    When a client connects to this server the server does a system output of an array in the servers class. Instead of simply out putting these array items to the screen, what code do i need to output them to the client. its a socket connection so im using get streams to handle input and output. I dont know how to send these array info to the client, that is my question
    here is my get stream codeprivate void getStreams() throws IOException
    // set up output stream for objects
    output = new ObjectOutputStream( connection.getOutputStream() );
    output.flush(); // flush output buffer to send header information
    // set up input stream for objects
    input = new ObjectInputStream( connection.getInputStream() );
    displayMessage( "\nGot I/O streams\n" );
    thanks for any help.

    thanks, i used writeObject cause it didnt like write
    for some reason. My next question is how can i make my
    client program read the array and form it own array
    with it.The simplest way is to create the array as the client needs it as send it via writeObject()
    You will be able to do a readObject() at the other end to get the object back.
    My client is currently using its own array of strings
    for reading info, i want to use the servers array
    instead.If you send a custom object, the code for these object(s) will need to be the same on the client and the server.

  • Need help with in-line HTML code

    I am trying to write some in-line HTML code to change the background color to blue for Exception-Bad.  Here is my code
    I am trying to use in-line HTML code in WAD to change the background color for Exceptions-Bad to blue.  This is not working.  I really need to get this to work so if someone could tell what is wrong with my code, I would really appreciate the help.
                <style type="text/css" > SAPBEXexcBad7 {background-color: blue}; .SAPBEXexcBad8 {background-color: blue}; SAPBEXexcBad9 {background-color: blue} </style>
    Thanks.
    Ryan

    Hi Boater,
    HTML code will also come like this also
    BODY BACKGROUND="image.jpg" BGCOLOR="#FFFFFF" TEXT="#000000"
    let this one also
    Regards
    Ashwin

  • Need help with paint (here my code)

    hi, i have problem with my paint method, if i put super.paint(g); all work perfectly but when you draw the program refresh all time, and does like flash effect taht i dotn want (test the code you'll see what im talking about) , and if i dont put super.paint(g) my component didnt paint... please help me, i know taht is a little bug, but i didnt have any kind of problem with swing before..
    thx
    //Debut imports
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.util.*;
    import java.net.*;
    import javax.swing.border.*;
    import javax.swing.event.*;
    //Fin imports
    //  Class: soudure
    public class soudure extends JApplet implements MouseListener, MouseMotionListener, ChangeListener
        //Debut Declarations
        boolean dessinConfig = false; //Savoir quand on utilise paint pour config
        Image img; //Image a dessiner
        int x = -1; //Sert pour savoir le point x de la souris
        int y = -1; //Sert pour savoir le point y de la souris
        int ovalHeight = 10; //Set la hauteur de l'oval
        int ovalWidth = 10; //Set la largeur de l'oval
        JLabel xCoord, //Coordonner de la souris X
               yCoord, //Coordonner de la souris Y
               lVoltage, //Identifie le voltage
               lAmperage; //Indeitifie l'amperage
        JPanel config, //Panel de configuration
               dessin, //Panel de dessin
               info; //Panel d'info
        JSlider voltage, //Set le voltage
                amperage; //Set l'amperage
        Vector sauvOvalXY; //Sauvegarde les points x et y des ovals
        Vector sauvOvalWH;  //Sauvegarde les largeur et hauteur des ovals
        //Fin Declarations
        //  Fonction: init()
        public void init()
            //Debut Initialisations
            config = new JPanel();   
            dessin = new JPanel();
            info = new JPanel();
            xCoord = new JLabel("X Coord.: ");
            yCoord = new JLabel("Y Coord.: ");
            voltage = new JSlider(JSlider.VERTICAL, 15,30,15);
            lVoltage = new JLabel("Voltage  15 :");
            amperage = new JSlider(JSlider.VERTICAL, 100,400,100);
            lAmperage = new JLabel("Amperage  100 :");
    //      img = new Image();
          sauvOvalXY = new Vector();
          sauvOvalWH = new Vector();
            //Fin Initialisations
            //Debut set Background
            config.setBackground(Color.lightGray);       
            dessin.setBackground(Color.white);
            //Fin set Background
            //Debut set layout
            dessin.setLayout(null);
            //Fin Set Layout
            //Add les listener
            dessin.addMouseListener(this);
            dessin.addMouseMotionListener(this);
            voltage.addChangeListener(this);
            amperage.addChangeListener(this);       
            //Fin Add listener
            //Divers settings
            dessin.setBorder(new MatteBorder(1,1,1,1,Color.black));
            config.setBorder(new MatteBorder(1,1,1,1,Color.black));
            info.setBorder(new MatteBorder(1,1,1,1,Color.black));
            voltage.setSize(20,10);
            amperage.setSize(20,10);
            //Set Size
            getContentPane().setSize(500,500);
            config.setBounds(0,0,500,100);
            dessin.setBounds(0,100,500,300);
            info.setBounds(0,400,500,100);       
            //Fin set Size
            //Debut ajout Panel
            info.add(xCoord);
            info.add(yCoord);
            config.add(lVoltage);
            config.add(voltage);
            config.add(lAmperage);
            config.add(amperage);
            getContentPane().add(config,"North");
            getContentPane().add(dessin,"Center");
            getContentPane().add(info,"South");       
            //Fin ajout Panel       
        //Fin Fonction init()
        //  Fonction: mouseClicked(MouseEvent)
        public void mouseClicked(MouseEvent e)
        //Fin Fonction mouseClicked(MouseEvent)
        //  Fonction: mouseDragged(MouseEvent)
        public void mouseDragged(MouseEvent e)
            //Prend l'objet sur lequel l'event est fait
            Object obj = e.getSource();
            x = e.getX();
            y = e.getY();
            //JPanel Dessin
            if(obj == dessin)
                repaint();
                positionSouris(e);
            //Fin JPanel dessin
        //Fin Fonction mouseDragged(MouseEvent)
        //  Fonction: mouseEntered(MouseEvent)
        public void mouseEntered(MouseEvent e)
            //positionSouris(e);
        //Fin Fonction mouseEntered(MouseEvent)
        //  Fonction: mouseExited(MouseEvent)
        public void mouseExited(MouseEvent e)
            //Met les coords de la souris a 0
            xCoord.setText("X Coord.: 0");
            yCoord.setText("Y Coord.: 0");
        //Fin Fonction mouseExited(MouseEvent)
        //  Fonction: mouseMoved(MouseEvent)
        public void mouseMoved(MouseEvent e)
            positionSouris(e);
        //Fin Fonction mouseMoved(MouseEvent)
        //  Fonction: mousePressed(MouseEvent)
        public void mousePressed(MouseEvent e)
        //Fin Fonction mousePressed(MouseEvent)
        //  Fonction: mouseReleased(MouseEvent)
        public void mouseReleased(MouseEvent e)
        //Fin Fonction mouseReleased(MouseEvent)
        //  Fonction: paint(Graphics)
        public void paint(Graphics g)
            super.paint(g);
            g = dessin.getGraphics();
            //Verifie si rien n'a encore ete dragger
            if(x != -1)
                //Sauvegarde les infos
                sauvOvalXY.add(new Point(x,y));
                sauvOvalWH.add(new Point(ovalWidth,ovalHeight));
                //Dessine les sauvegarde
                int size = sauvOvalXY.size();
                for(int i=0;i<size;i++)
                    Point tmpXY = (Point)sauvOvalXY.get(i);
                    Point tmpWH = (Point)sauvOvalWH.get(i);
                    g.fillOval(tmpXY.x,tmpXY.y,tmpWH.x,tmpWH.y);
                g.fillOval(x,y,this.ovalWidth,this.ovalHeight);
    /*        //Si dessine pour panel config
            if(dessinConfig)
                g = config.getGraphics();
                g.drawImage(img,0,0,100,100,this);
               // dessinConfig = false;
        //Fin Fonction paint(Graphics)
        //  Fonction: positionSouris(MouseEvent)
        public void positionSouris(MouseEvent e)
            int tmpX = e.getX();
            int tmpY = e.getY();
            xCoord.setText("X Coord.: " + Integer.toString(tmpX));
            yCoord.setText("Y Coord.: " + Integer.toString(tmpY));
        //Fin Fonction positionSouris(MouseEvent)
        //  Fonction: stateChanged(ChangeEvent)
        public void stateChanged(ChangeEvent e)
            //Verifie lobject actuel
            Object obj = e.getSource();
            //Voltage
            if(obj == voltage)
                int tmpVoltage = voltage.getValue();
                lVoltage.setText("Voltage  " + Integer.toString(tmpVoltage) + " :");
            //Fin voltage
            else
                //Voltage
                if(obj == amperage)
                    int tmpAmperage = amperage.getValue();
                    lAmperage.setText("Amperage  " + Integer.toString(tmpAmperage) + " :");
                //Fin voltage       
        //Fin Fonction stateChanged(ChangeEvent)
    }

    Hi,
    For Swing components you need to override the paintComponent method instead of paint. In your case you can't do that with the approach you have taken. Here is how you can do it:
    1. Remove your paint method
    2. Change your creation of the dessin JPanel and override its' paintComponent method using an anonymous class.
        dessin = new JPanel()
                    public void paintComponent( Graphics g )   
                      super.paintComponent(g);      
                      //Verifie si rien n'a encore ete dragger 
                      if(x != -1)       
                        //Sauvegarde les infos
                        sauvOvalXY.add(new Point(x,y));
                        sauvOvalWH.add(new Point(ovalWidth,ovalHeight));
                        //Dessine les sauvegarde          
                        int size = sauvOvalXY.size(); 
                        for(int i=0;i<size;i++)         
                          Point tmpXY = (Point)sauvOvalXY.get(i);
                          Point tmpWH = (Point)sauvOvalWH.get(i);
                          g.fillOval(tmpXY.x,tmpXY.y,tmpWH.x,tmpWH.y);
                        g.fillOval(x,y,ovalWidth,ovalHeight);
                 };This will allow you to override the correct method and still use all of your applet class variables. Notice that I have removed the line getting the graphics of dessin because it is now being passed into the paintComponent method.
    The two steps above should remove any flashing that you may have had.
    Regards,
    Manfred.

  • Need help with creating custom form

    hi all,
    i'm working on creating a new form. it has 2 blocks for 2 tables. headers and lines tables. the headers table mostly have columns that are id's from other tables. i.e. customer_id, location_id etc.. in my screen, obviously i would not show the id's. i'll display the descriptions / names of the id's instead like customer_name for customer_id... but in order to do this i created a table that joins more than 2 tables. so in the block query data source name, i enter the name of this view.. then i add a ON-INSERT, ON-UPDATE, ON-DELETE triggers at block level and i call the corresponding package which does the insert, update and delete. i'm able to insert but update and delete causes a problem. "ORA-01445: cannot select ROWID from, or sample, a join.. ".. i'm thinking the reason is that when the form does an update or delete, it locks the record which causes the error.. also the reason i need the view is because i need to be able to query the customer_name in the screen instead of the customer_id... what i can't figure out is how i can make this work... or a work-around may be...
    can anyone help.
    thanks

    Matt Rasmussen wrote:
    You're right that the form is locking the record so you just need to control how it locks the record with an on-lock trigger. From the Oracle Applications Developer's Guide:
    page 3-9:
    When basing a block on a view, you must code ON–INSERT, ON–UPDATE, ON–DELETE, and ON–LOCK triggers to insert, update, delete, and lock the root table instead of the view.
    Most of the on-lock triggers I have written follow this template:
    <pre>     SELECT     field1, field2, field3
         INTO     :block.field3, :block.field2, :block.field3
         FROM     view
         WHERE     rowid = :block.row_id
         FOR UPDATE OF field1, field2, field3;</pre>
    I think once you've added this trigger, your form will work the way you want it.hi,
    i tried your suggestion but still get the same error.. anyways, here are the details of what i have so far.
    here's my table.
    CREATE TABLE XXPN_VR_VOL_HEADERS_ALL
      VOL_HEADER_ID     NUMBER,
      CUSTOMER_ID       NUMBER,
      LEASE_ID          NUMBER,
      LOCATION_ID       NUMBER,
      VAR_RENT_ID       NUMBER,
      PERIOD_SET_NAME   VARCHAR2(15 BYTE),
      PERIOD_NAME       VARCHAR2(15 BYTE),
      IMPORT_FLAG       VARCHAR2(1 BYTE),
      IMPORT_DATE       DATE,
      CALC_TYPE         VARCHAR2(30 BYTE),
      PASSTHROUGH_FLAG  VARCHAR2(1 BYTE),
      COMMENTS          VARCHAR2(2000 BYTE),
      CREATED_BY        NUMBER,
      CREATION_DATE     DATE,
      LAST_UPDATED_BY   NUMBER,
      LAST_UPDATE_DATE  DATE
    );here's my view.
    create or replace view xxpn_vr_vol_headers_v ( row_id
                                                  ,vol_header_id
                                                  ,customer_id
                                                  ,customer_name
                                                  ,lease_id
                                                  ,lease_name
                                                  ,lease_number
                                                  ,location_id
                                                  ,location_code
                                                  ,var_rent_id
                                                  ,var_rent_number
                                                  ,period_set_name
                                                  ,period_name
                                                  ,import_flag
                                                  ,import_date
                                                  ,calc_type
                                                  ,passthrough_flag
                                                  ,created_by
                                                  ,creation_date
                                                  ,comments
                                                  ,last_updated_by
                                                  ,last_update_date )
    as
      select xvvha.rowid
            ,xvvha.vol_header_id
            ,xvvha.customer_id
            ,hp.party_name
            ,xvvha.lease_id
            ,pl.name
            ,pl.lease_num
            ,xvvha.location_id
            ,loc.location_code
            ,xvvha.var_rent_id
            ,pvr.rent_num
            ,xvvha.period_set_name
            ,xvvha.period_name
            ,xvvha.import_flag
            ,xvvha.import_date
            ,xvvha.calc_type
            ,xvvha.passthrough_flag
            ,xvvha.created_by
            ,xvvha.creation_date
            ,xvvha.comments
            ,xvvha.last_updated_by
            ,xvvha.last_update_date
        from xxpn_vr_vol_headers_all xvvha
            ,hz_parties hp
            ,pn_leases_all pl
            ,pn_locations_all loc
            ,pn_var_rents_v pvr
       where -1 = -1
         and xvvha.customer_id = hp.party_id (+)
         and xvvha.lease_id = pl.lease_id (+)
         and xvvha.location_id = loc.location_id (+)
         and xvvha.var_rent_id = pvr.var_rent_id (+);here's my ON-UPDATE trigger block level
    begin
      xxpn_vr_vol_data_pkg.update_vr_vol_hdr_data ( p_vol_header_id     => :XXPNVRVOLHDRS.vol_header_id
                                                   ,p_customer_id       => :XXPNVRVOLHDRS.customer_id
                                                   ,p_lease_id          => :XXPNVRVOLHDRS.lease_id
                                                   ,p_location_id       => :XXPNVRVOLHDRS.location_id
                                                   ,p_var_rent_id       => :XXPNVRVOLHDRS.var_rent_id
                                                   ,p_period_set_name   => :XXPNVRVOLHDRS.period_set_name
                                                   ,p_period_name       => :XXPNVRVOLHDRS.period_name
                                                   ,p_import_flag       => :XXPNVRVOLHDRS.import_flag
                                                   ,p_passthrough_flag  => :XXPNVRVOLHDRS.passthrough_flag
                                                   ,p_comments          => :XXPNVRVOLHDRS.comments
                                                   ,x_last_updated_by   => :XXPNVRVOLHDRS.last_updated_by
                                                   ,x_last_update_date  => :XXPNVRVOLHDRS.last_update_date );
    end;here's my code in ON-LOCK trigger block level
    begin
      select lease_id
            ,lease_name
            ,lease_number
            ,location_id
            ,location_code
            ,customer_id
            ,customer_name
            ,var_rent_id
            ,var_rent_number
            ,period_name
            ,comments
            ,period_set_name
            ,import_flag
            ,passthrough_flag
            ,created_by
            ,creation_date
            ,last_updated_by
            ,last_update_date
        into :XXPNVRVOLHDRS.lease_id
            ,:XXPNVRVOLHDRS.lease_name
            ,:XXPNVRVOLHDRS.lease_number
            ,:XXPNVRVOLHDRS.location_id
            ,:XXPNVRVOLHDRS.location_code
            ,:XXPNVRVOLHDRS.customer_id
            ,:XXPNVRVOLHDRS.customer_name
            ,:XXPNVRVOLHDRS.var_rent_id
            ,:XXPNVRVOLHDRS.var_rent_number
            ,:XXPNVRVOLHDRS.period_name
            ,:XXPNVRVOLHDRS.comments
            ,:XXPNVRVOLHDRS.period_set_name
            ,:XXPNVRVOLHDRS.import_flag
            ,:XXPNVRVOLHDRS.passthrough_flag
            ,:XXPNVRVOLHDRS.created_by
            ,:XXPNVRVOLHDRS.creation_date
            ,:XXPNVRVOLHDRS.last_updated_by
            ,:XXPNVRVOLHDRS.last_update_date
        from xxpn_vr_vol_headers_v
       where rowid = :XXPNVRVOLHDRS.ROW_ID
         for update of lease_id
                      ,lease_name
                      ,lease_number
                      ,location_id
                      ,location_code
                      ,customer_id
                      ,customer_name
                      ,var_rent_id
                      ,var_rent_number
                      ,period_name
                      ,comments
                      ,period_set_name
                      ,import_flag
                      ,passthrough_flag
                      ,created_by
                      ,creation_date
                      ,last_updated_by
                      ,last_update_date;
    end;properties for the block
    Query Data Source Type: Table
    Query Data Source Name: XXPN_VR_VOL_HEADERS_V
    DML Target Type: Table
    DML Target Name: XXPN_VR_VOL_HEADERS_V
    i'd appreciate any help.
    thanks

  • I need help with this program ( Calculating Pi using random numbers)

    hi
    please understand that I am not trying to ask anymore to do this hw for me. I am new to java and working on the assignment. below is the specification of this program:
    Calculate PI using Random Numbers
    In geometry the ratio of the circumference of a circle to its diameter is known as �. The value of � can be estimated from an infinite series of the form:
    � / 4 = 1 - (1/3) + (1/5) - (1/7) + (1/9) - (1/11) + ...
    There is another novel approach to calculate �. Imagine that you have a dart board that is 2 units square. It inscribes a circle of unit radius. The center of the circle coincides with the center of the square. Now imagine that you throw darts at that dart board randomly. Then the ratio of the number of darts that fall within the circle to the total number of darts thrown is the same as the ratio of the area of the circle to the area of the square dart board. The area of a circle with unit radius is just � square unit. The area of the dart board is 4 square units. The ratio of the area of the circle to the area of the square is � / 4.
    To simuluate the throwing of darts we will use a random number generator. The Math class has a random() method that can be used. This method returns random numbers between 0.0 (inclusive) to 1.0 (exclusive). There is an even better random number generator that is provided the Random class. We will first create a Random object called randomGen. This random number generator needs a seed to get started. We will read the time from the System clock and use that as our seed.
    Random randomGen = new Random ( System.currentTimeMillis() );
    Imagine that the square dart board has a coordinate system attached to it. The upper right corner has coordinates ( 1.0, 1.0) and the lower left corner has coordinates ( -1.0, -1.0 ). It has sides that are 2 units long and its center (as well as the center of the inscribed circle) is at the origin.
    A random point inside the dart board can be specified by its x and y coordinates. These values are generated using the random number generator. There is a method nextDouble() that will return a double between 0.0 (inclusive) and 1.0 (exclusive). But we need random numbers between -1.0 and +1.0. The way we achieve that is:
    double xPos = (randomGen.nextDouble()) * 2 - 1.0;
    double yPos = (randomGen.nextDouble()) * 2 - 1.0;
    To determine if a point is inside the circle its distance from the center of the circle must be less than the radius of the circle. The distance of a point with coordinates ( xPos, yPos ) from the center is Math.sqrt ( xPos * xPos + yPos * yPos ). The radius of the circle is 1 unit.
    The class that you will be writing will be called CalculatePI. It will have the following structure:
    import java.util.*;
    public class CalculatePI
    public static boolean isInside ( double xPos, double yPos )
    public static double computePI ( int numThrows )
    public static void main ( String[] args )
    In your method main() you want to experiment and see if the accuracy of PI increases with the number of throws on the dartboard. You will compare your result with the value given by Math.PI. The quantity Difference in the output is your calculated value of PI minus Math.PI. Use the following number of throws to run your experiment - 100, 1000, 10,000, and 100,000. You will call the method computePI() with these numbers as input parameters. Your output will be of the following form:
    Computation of PI using Random Numbers
    Number of throws = 100, Computed PI = ..., Difference = ...
    Number of throws = 1000, Computed PI = ..., Difference = ...
    Number of throws = 10000, Computed PI = ..., Difference = ...
    Number of throws = 100000, Computed PI = ..., Difference = ...
    * Difference = Computed PI - Math.PI
    In the method computePI() you will simulate the throw of a dart by generating random numbers for the x and y coordinates. You will call the method isInside() to determine if the point is inside the circle or not. This you will do as many times as specified by the number of throws. You will keep a count of the number of times a dart landed inside the circle. That figure divided by the total number of throws is the ratio � / 4. The method computePI() will return the computed value of PI.
    and below is what i have so far:
    import java.util.*;
    public class CalculatePI
      public static boolean isInside ( double xPos, double yPos )
         double distance = Math.sqrt( xPos * xPos + yPos * yPos );        
      public static double computePI ( int numThrows )
        Random randomGen = new Random ( System.currentTimeMillis() );
        double xPos = (randomGen.nextDouble()) * 2 - 1.0;
        double yPos = (randomGen.nextDouble()) * 2 - 1.0;
        int hits = 0;
        int darts = 0;
        int i = 0;
        int areaSquare = 4 ;
        while (i <= numThrows)
            if (distance< 1)
                hits = hits + 1;
            if (distance <= areaSquare)
                darts = darts + 1;
            double PI = 4 * ( hits / darts );       
            i = i+1;
      public static void main ( String[] args )
        Scanner sc = new Scanner (System.in);
        System.out.print ("Enter number of throws:");
        int numThrows = sc.nextInt();
        double Difference = PI - Math.PI;
        System.out.println ("Number of throws = " + numThrows + ", Computed PI = " + PI + ", Difference = " + difference );       
    }when I tried to compile it says "cannot find variable 'distance' " in the while loop. but i thought i already declare that variable in the above method. Please give me some ideas to solve this problem and please check my program to see if there is any other mistakes.
    Thanks a lot.

    You've declared a local variable, distance, in the method isInside(). The scope of this variable is limited to the method in which it is declared. There is no declaration for distance in computePI() and that is why the compiler gives you an error.
    I won't check your entire program but I did notice that isInside() is declared to be a boolean method but doesn't return anything, let alone a boolean value. In fact, it doesn't even compute a boolean value.

  • Need help with the following condition code

    Hi All,
    I am creating CreditMemo based on the open amount and I have option to create either up to 4 credit memo's or open amount is zero. When I create the CM initially then cmponum1 has to be updated in the table, for second CM cmponum2 has to be updated.
    The created CM number comes out from the function as 'Salesdocument'.
    The following code I wrote is working fine for CM1, if I have the CM2 then it is updating CMPONUM2 but update command is making CMPONUM1 as zero, so for CM3 as CM1 was updated as zero it is going to CMPONUM1 instead of CMPONUM3.
    Can some one please help me with this code.
    Thanks,
    Veni.
          DATA: zcmponum1  type zsdcoop-cmponum,
                zcmponum2  type zsdcoop-cmponum,
                zcmponum3  type zsdcoop-cmponum,
                zcmponum4  type zsdcoop-cmponum.
          If zsdcoop-cmponum1 is initial.
            zcmponum1 = salesdocument.
          elseif zsdcoop-cmponum2 is initial.
            zcmponum2 = salesdocument.
          elseif zsdcoop-cmponum3 is initial.
            zcmponum3 = salesdocument.
          elseif zsdcoop-cmponum4 is initial.
            zcmponum4 = salesdocument.
          endif.
          Update zsdcoop
          set
          cmponum1  = zcmponum1
          cmponum2  = zcmponum2
          cmponum3  = zcmponum3
          cmponum4  = zcmponum4
          where kunnr = zsdcoop-kunnr and pfnum = zsdcoop-pfnum.

    Hi All,
    This code solved my req.
          If zsdcoop-cmponum is initial.
            zcmponum = salesdocument.
            Update zsdcoop
            set cmponum  = zcmponum
            where kunnr = zsdcoop-kunnr and pfnum = zsdcoop-pfnum.
          elseif zsdcoop-cmponum2 is initial.
            zcmponum2 = salesdocument.
            Update zsdcoop
            set cmponum2  = zcmponum2
            where kunnr = zsdcoop-kunnr and pfnum = zsdcoop-pfnum.
          elseif zsdcoop-cmponum3 is initial.
            zcmponum3 = salesdocument.
            Update zsdcoop
            set cmponum3  = zcmponum3
            where kunnr = zsdcoop-kunnr and pfnum = zsdcoop-pfnum.
          elseif zsdcoop-cmponum4 is initial.
            zcmponum4 = salesdocument.
            Update zsdcoop
            set cmponum4  = zcmponum4
            where kunnr = zsdcoop-kunnr and pfnum = zsdcoop-pfnum.
          endif.
    Thanks,
    Veni.

  • Need help with simple VS2005 C++ code

    I'm not sure if I am doing something wrong, or if the Switch Front Panel isn't expected to reflect the results of my code.  I have a virtual 1163 cart setup in MAX.  I start the Switch Soft Front Panel and can see the state of the channels. I have auto refresh turned on.
    My C++ code has a task generated by the .mxb file.  The channel is configured this way: 
    void CDAQmxTask::Configure()
       CNiDAQmxDOChannel ch = DOChannels.CreateChannel("SC1Mod6/port0/line2", "DigitalOut", DAQmxOneChannelForEachLine);
        ch.InvertLines = false;
    For simplicity sake, I create a gobal instance  of this class at the top of the dlg class file:
    CDAQmxTask task;
    I have a single button that when pressed should turn on channel 2 
    void CFVT_TestAppDlg:nBnClickedButton1()
        task.Stop();
        CNiDAQmxDigitalSingleChannelWriter* writer = new CNiDAQmxDigitalSingleChannelWriter(task.Stream);
        writer->WriteSingleSampleSingleLine(TRUE, TRUE);
        delete writer;
    Should I expect to see teh results of this code in either the Schematic or Relays tab of SwitchSoft FP?

    AiR_GuNNeR,
    You will not see the NI-Switch Soft Front Panel (SSFP) update to reflect the results of your Visual Studio code.  This is because NI-Switch is an IVI compliant driver, and IVI compliance for switches requires the driver to be able to open multiple driver sessions with one switch.  As a result, your C++ program and the SSFP have each established a seperate, independant IVI driver session to the switch.
    For example, if your C++ program instructs Relay 1 to close, the relay will close.  Then, if the SSFP instructs Relay 1 to close, nothing will happen since the relay is already closed.  The SSFP can also instruct Relay 1 to open, and it will, regardless of the fact that your C++ program gave no such command.
    As a result, it is important that for switching applications, you be sure that you only have one session open to a given switch at a time, otherwise you may see unexpected behavior.  This can even happen within an application.
    You can lock a session within your application so that no other thread in your application can access that driver session.  Do this using the niSwitch_LockSession function.  You can find more information on this function in the NI-Switch shipping help.
    Seth B.
    Staff Test Engineer | National Instruments
    Certified LabVIEW Developer
    Certified TestStand Developer
    “Engineers like to solve problems. If there are no problems handily available, they will create their own problems.”- Scott Adams

  • Need HELP with crazy rendering /  saving problem

    I am finishing up a project that I need to deliver on DVD in the next couple of days.
    Suddenly, something strange is happening.
    There are several audio clips that have some filters applied to them. When I play them in the timeline, they sound fine, until I render them.
    Then, the audio in those clips gets muddy and way quiet.
    When I click off the filter, the volume comes back.
    Then, if I click on the filter again, the filtered settings are applied and it sounds fine.
    However, as soon as I render, it all goes wacky again.
    This is making me nervous, as the deadline is looming.
    THanks for any help.

    What are your timeline settings for audio? What are the filters for? If you export a small section as a test, does the audio sound bad when you play back the quicktime?
    I just remembered - when I experienced this before, it was the result of audio that was inverted in one channel, so as long as they came out of separate speakers, there was no problem, but when they were mixed, they canceled each other out resulting in severely decreased volume.
    As my problem was just with Voice Over, I simply deleted one of the audio channels, then doubled the remaining one and panned it properly.
    Dunno if that's your issue, but you might investigate that...
    Patrick

  • I need help with resetting my security code answers, nothing seems to be helping

    since I usually use  my phone instead of my computer to download and buy music it is making me use a security code and i forgot the answers. Help?

    You need to contact Apple to get the questions reset. Click here, phone them, and ask for the Account Security team, or fill out and submit this form.
    (95710)

Maybe you are looking for

  • Ibook to Macbook

    A company that i interned with for the summer order an ibook for me. The only problem is apple now has updated mackbooks. I was wondering if i could take it in to the apple store and pay the difference for a macbook or higher

  • Are New CD-R's Incompatible w/iMac?

    Hi All, Two new Verbatim CD-R 52X discs failed to complete a Backup burn. I had an older Verbatim CD-R 48X disc, tried that, and it worked. Are the new 52X discs incompatible with the CD drive in my iMac? I successfully burned 100 photos from iPhoto

  • Mobile Broadband Unit not found for T400 WAN

    Hello, I've got a Lenovo T400 27658JG with Win 7 64bit and I try to activate my Mobile Broadband Unit. I've loaded down the driver: Lenovo Mobile Broadband  Version 3.5.0011 and  the ericson and AT&T driver (which worked properly on XP) When i'm laun

  • Use of SUS with bidding Engine

    Dear all, I want to use the BBPSC18 for request services (external labour). Then I want to use the bidding engine to create bid invitation from sourcing cockpit. From this point I have some questions - I read it is not necessary to use SUS for this p

  • Can u create a 'slow merging' link between pages

    I'm creating a link so when u click a word it loads another page but instead of an 'instant' transition, can u make it blend/merge slowly? Thx