Eigen Calculations in Java

Hi,
Iam currently writing java code for PCA statistical calculation (for 500*500 matrix) in Java. I would have to match the results with SAS calculation of PCA using PRINCOMP PROC.
Could somebody help on java resources available for statistical calculations. I tried some, they follow algorithms like QR/Householder, Jacobi. But the results are not matching SAS. I am currently off by more decimal places for Eigen calculations when compared to SAS.
Appreciate you direction on this.
Thanks,
Shyam

ShyamKrishnan wrote:
Sorry being precised in prevous post. Please see my answers below:
Is this what you're doing? -Yes
http://www.pfc.forestry.ca/profiles/wulder/mvstats/pca_fa_e.html
You say your matricies are "huge", but you don't give any other information about whether they're symmetric, sparse, banded, etc.
They matrix is of order 800*7000. Not square? Oh, my.
They dont follow any specific category like symmetric or sparse.. Not symmetric - so you have complex eigenvalues.
You don't say if you need just eigenvalues or eigenvectors, too. - Need both Eigen vectors and valuesSAS gets these for you?
You don't say if you need all the eigenvalues or just the first few. - Need allWhat algorithm is SAS using?
I'm confused about the precision problem. Isn't that determined by the floating point representation? Its not due to floating point.. I mean there is something more than that.Like what? There might be accumulated numerical error in the algorithm, but if that's the case don't use the word precision.
Maybe you need a method with shifts. - May be you r rightPower method with shifts, but the one that I've seen is for symmetric matricies with real eigenvalues.
Did you write the eigenvalue extraction yourself? - Mine was not as good as jama. Obviously.
What algorithm did you choose? Was it appropriate for non-symmetric matricies?
Or did you just use JAMA - Yes but it didnt match for huge dataWhat does "match" look like? Were some of the eigenvalues off? All of them? The eigenvectors? What were the absolute and relative errors? You're talking about hundreds of eigenvalues and their corresponding eigenvectors.
The physics problems that I'm used to result in square, symmetric matricies and real eigenvectors. The eigenvectors span the space and form a basis. What happens with a non-square matrix? What's the basis in that case?
If SAS has already given you the values, why is it necessary to do it again with Java? - Rqmt is to rewrite the SAS in JavaSo it's a school assignment.
How are you checking correctness? What makes you so sure that SAS is 100% correct?
Have you tried JAMA and your home-rolled code against some known problems to make sure that you understand what's going on? You're a fool if you submit your full case and use that to decide the fate of the code.
%

Similar Messages

  • How is the length of a string calculated in Java?  and JavaScript?

    Hi all,
    Do any of you know how the length of a string is being calculated in Java and JavaScript? For example, a regular char is just counted as 1 char, but sometimes other chars such as CR, LF, and CR LF are counted as two. I know there are differences in the way Java and JavaScript calculate the length of a string, but I can't find any sort of "rules" on those anywhere online.
    Thanks,
    Yim

    What's Unicode 4 got to do with it? 1 characteris 1
    character is 1 character.
    strings now contain (and Java chars also) is
    UTF-16 code units rather than Unicode characters
    or
    code points. Unicode characters outside the BMPare
    encoded in Java as two or more code units. So it would seem that in some cases, a single
    "character" on the screen, will require two charsto
    represent it.So... you're saying that String.length() doesn't
    account for that? That sux. I don't know. I'm just making infrerences (==WAGs) based on what DrClap said.
    I assume it would return the number of chars in the array, rather than the number of symbols (glyphs?) this translates into. But I might have it bass ackwards.

  • Wrong values from calculated field (Java API)

    Hi All,
    Help me please solve the problem.
    We have a table with calculated text field in MDM repositor. For some records the value of this field in MDM Data Manager differs from the value returned when we read record by MDM Java API.
    Parameters of system:
    MDM ver.: 7.1 SP10
    DBMS: Oracle
    OS: Linux
    The issue solved. I've found error in program code :-)
    I apologize for the worry.

    Assuming you want every field, the equivalent of "SELECT *" in SQL, you can use the RepositorySchema object to get a TableSchema, and with that get all FieldIds for the table.
    If your RepositorySchema variable is rs it would be something along the lines of:
    TableSchema mainTableSchema = rs.getTableSchema(mainTableId);
    ResultDefinition rd = new ResultDefinition(mainTableId);
    rd.setSelectFields(mainTableSchema.getFieldIds());
    Hope this helps,
    Greg

  • Mortgage Calculator in Java

    Can anyone help me figure out how to change my mortgage calculator to do the following?
    Modify the mortgage program to display the mortgage payment amount. Then, list the loan balance and interest paid for each payment over the term of the loan. The list would scroll off the screen, but use loops to display a partial list, hesitate, and then display more of the list. Do not use a graphical user interface. Insert comments in the program to document the program. Here is the code I have currently.
    import java.io.*;
    import java.text.DecimalFormat;
    public class MortgageRateWeek3Test
         public static void main(String[] args) throws IOException
              //Declaring and Constructing Variables
              int iTerm;
              double dInterest = 5.75;
              double dPayment, dRate, dAmount = 200000, dMonthlyInterest,dMonthlyPrincipal, dMonthlyBalance;
              DecimalFormat twoDigits = new DecimalFormat("$#,000.00");
                        //Calculations Retrieved from http://www.1728.com/loanform.htm on 9/14/05
                        dRate = dInterest / 1200;
                        iTerm = 360;
                        dPayment = (dAmount * dRate) / (1 - Math.pow(1 / (1 + dRate), iTerm));
                        dMonthlyInterest = (dAmount / 12) * (dInterest / 100);
                        dMonthlyPrincipal = (dPayment - dMonthlyInterest);
                        dMonthlyBalance = (dAmount - dMonthlyPrincipal);
                                  // Output dPayment
                                  System.out.println();
                                  System.out.println("\tYour Monthly Payment is: " + twoDigits.format (dPayment));
                                  System.out.println();
         public class monthlyInterest
              //Declaring Variables for monthlyInterest
              double dMonthlyInterest = 0.0;
              double dAmount = 0.0;
              double dInterest = 0.0;
                   //Calculations for monthlyInterest
                   dMonthlyInterest = (dAmount / 12) * (dInterest / 100);
              return dMonthlyInterest;
         public static double monthlyPrincipal()
              //Declaring Variables for monthlyPrincipal
              double dMonthlyPrincipal = 0.0;
              double dPayment = 0.0;
              double dMonthlyInterest = 0.0;
                   //Calculations for monthlyPrincipal
                   dMonthlyPrincipal = (dPayment - dMonthlyInterest);
              return dMonthlyPrincipal;
         public static double monthlyBalance()
              //Declaring Variables for monthlyBalance
              double dMonthlyBalance = 0.0;
              double dAmount = 0.0;
              double dMonthlyPrincipal = 0.0;
                   //Calculations for monthlyBalance
                   dMonthlyBalance = (dAmount - dMonthlyPrincipal);
              return dMonthlyBalance;
    }

    There are imports that aren't available to us, so no. nobody probaly can. Of course maybe someon could be bothered going through all of your code, and may spot some mistake. But I doubt they will since you didn't bother to use [c[b]ode] tags.

  • Money calculation using Java

    Hi,
    I have problem with calculating the total amounts. I am not sure what's wrong with the below code snippet, could anyone help me please.
    If the value of authDoubleAmount in line 3 of code below is 34.8, by casting to long it returns 3479. I am loosing the precession of value 01 after the decimal point. How do I get 3480 instead of 3479.
    BigDecimal authBigDecimalAmount =authMoneyAmount.getRoundedValue(2, BigDecimal.ROUND_HALF_DOWN);
    double authDoubleAmount = authBigDecimalAmount.doubleValue();
    long authLongAmount = (long) (authDoubleAmount * 100);
    Thanks

    If you are working with money, you SHOULD NEVER use float or double, for they represent numbers in a non continuous way (there are numbers lacking, that they cannot hold) , you should work with them through the BigDecimal mehtods.
    May the code be with you.

  • Help Please Needed for Java Calculator - ActionListener HELP

    Hi. I am constructing a simple Java calculator and need help with the actionlistener and how it could work with my program. I am not too sure how to begin constructing the actionlistener. I would like to know the best and most simple solution to get this program work the way it should, like a real calculator. If anyone can help me, that would be much appreciated.
    package calculator;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.event.*;
    public class CalculatorGUI extends JFrame implements ActionListener{
    JTextField screen;
    JButton button7;
    JButton button8;
    JButton button9;
    JButton button4;
    JButton button5;
    JButton button6;
    JButton button1;
    JButton button2;
    JButton button3;
    JButton button0;
    JButton add;
    JButton minus;
    JButton multiply;
    JButton divide;
    JButton equals;
    JButton clear;
    private JTextField m_displayField;
    private boolean m_startNumber = true;
    private String m_previousOp = "=";
    private CalculatorLogic m_logic = new CalculatorLogic();
    public CalculatorGUI() {
    CalculatorGUILayout customLayout = new CalculatorGUILayout();
    getContentPane().setFont(new Font("Helvetica", Font.PLAIN, 12));
    getContentPane().setLayout(customLayout);
    screen = new JTextField("textfield_1");
    getContentPane().add(screen);
    button7 = new JButton("7");
    getContentPane().add(button7);
    button7.addActionListener(this);
    button8 = new JButton("8");
    getContentPane().add(button8);
    button8.addActionListener(this);
    button9 = new JButton("9");
    getContentPane().add(button9);
    button9.addActionListener(this);
    button4 = new JButton("4");
    getContentPane().add(button4);
    button4.addActionListener(this);
    button5 = new JButton("5");
    getContentPane().add(button5);
    button5.addActionListener(this);
    button6 = new JButton("6");
    getContentPane().add(button6);
    button6.addActionListener(this);
    button1 = new JButton("1");
    getContentPane().add(button1);
    button1.addActionListener(this);
    button2 = new JButton("2");
    getContentPane().add(button2);
    button2.addActionListener(this);
    button3 = new JButton("3");
    getContentPane().add(button3);
    button3.addActionListener(this);
    button0 = new JButton("0");
    getContentPane().add(button0);
    button0.addActionListener(this);
    add = new JButton("+");
    getContentPane().add(add);
    add.addActionListener(this);
    minus = new JButton("-");
    getContentPane().add(minus);
    minus.addActionListener(this);
    multiply = new JButton("*");
    getContentPane().add(multiply);
    multiply.addActionListener(this);
    divide = new JButton("/");
    getContentPane().add(divide);
    divide.addActionListener(this);
    equals = new JButton("=");
    getContentPane().add(equals);
    equals.addActionListener(this);
    clear = new JButton("Clear");
    getContentPane().add(clear);
    clear.addActionListener(this);
    setSize(getPreferredSize());
    addWindowListener(new WindowAdapter() {
    public void windowClosing(WindowEvent e) {
    System.exit(0);
    public void actionPerformed(ActionEvent event) {
    public static void main(String args[]) {
    CalculatorGUI window = new CalculatorGUI();
    window.setTitle("Calculator");
    window.pack();
    window.show();
    class CalculatorGUILayout implements LayoutManager {
    public CalculatorGUILayout() {
    public void addLayoutComponent(String name, Component comp) {
    public void removeLayoutComponent(Component comp) {
    public Dimension preferredLayoutSize(Container parent) {
    Dimension dim = new Dimension(0, 0);
    Insets insets = parent.getInsets();
    dim.width = 421 + insets.left + insets.right;
    dim.height = 494 + insets.top + insets.bottom;
    return dim;
    public Dimension minimumLayoutSize(Container parent) {
    Dimension dim = new Dimension(0, 0);
    return dim;
    public void layoutContainer(Container parent) {
    Insets insets = parent.getInsets();
    Component c;
    c = parent.getComponent(0);
    if (c.isVisible()) {c.setBounds(insets.left+8,insets.top+8,408,64);}
    c = parent.getComponent(1);
    if (c.isVisible()) {c.setBounds(insets.left+8,insets.top+80,96,56);}
    c = parent.getComponent(2);
    if (c.isVisible()) {c.setBounds(insets.left+120,insets.top+80,96,56);}
    c = parent.getComponent(3);
    if (c.isVisible()) {c.setBounds(insets.left+232,insets.top+80,96,56);}
    c = parent.getComponent(4);
    if (c.isVisible()) {c.setBounds(insets.left+8,insets.top+144,96,56);}
    c = parent.getComponent(5);
    if (c.isVisible()) {c.setBounds(insets.left+120,insets.top+144,96,56);}
    c = parent.getComponent(6);
    if (c.isVisible()) {c.setBounds(insets.left+232,insets.top+144,96,56);}
    c = parent.getComponent(7);
    if (c.isVisible()) {c.setBounds(insets.left+8,insets.top+208,96,56);}
    c = parent.getComponent(8);
    if (c.isVisible()) {c.setBounds(insets.left+120,insets.top+208,96,56);}
    c = parent.getComponent(9);
    if (c.isVisible()) {c.setBounds(insets.left+232,insets.top+208,96,56);}
    c = parent.getComponent(10);
    if (c.isVisible()) {c.setBounds(insets.left+120,insets.top+272,96,56);}
    c = parent.getComponent(11);
    if (c.isVisible()) {c.setBounds(insets.left+344,insets.top+80,72,56);}
    c = parent.getComponent(12);
    if (c.isVisible()) {c.setBounds(insets.left+344,insets.top+144,72,56);}
    c = parent.getComponent(13);
    if (c.isVisible()) {c.setBounds(insets.left+344,insets.top+208,72,56);}
    c = parent.getComponent(14);
    if (c.isVisible()) {c.setBounds(insets.left+344,insets.top+272,72,56);}
    c = parent.getComponent(15);
    if (c.isVisible()) {c.setBounds(insets.left+344,insets.top+336,72,56);}
    c = parent.getComponent(16);
    if (c.isVisible()) {c.setBounds(insets.left+8,insets.top+408,408,72);}
    }

    Yeah, I have a rough idea of what the calculator
    should do, like most people would. Its just that I
    dont know how to implement this in Java. Thats the
    problem. Can anyone provide me with code snippets
    that I can try?No I would rather see you make an effort from what has been discussed here. This is not a Java problem this is a general programming problem.

  • Java Recursively sum up the Excel column values

    I have a requirement to perform some calculations using java taking inputs from Excel file.
    My Excel file content is as follows:
    Row[0] ECOUT - EXPECTED VALUE | TotalDownPaymentAmount = 900.00
    Row[1] ECIN - INPUT VALUE (ADD)     | NetTradeAllowanceAmount = -600.00
    Row[2] ECIN - INPUT VALUE (ADD) | CashDownPayment = 100.00
    Row[3] ECIN - INPUT VALUE (ADD)     | OtherDownPaymentAmount = PATH DOES NOT EXIST
    Row[4] ECIN - INPUT VALUE (ADD) | ManufacturerRebateAmount = 250.00
    Row[5] ECIN - INPUT VALUE (ADD) | DeferredDownPaymentAmount = PATH DOES NOT EXIST
    Row[6] ECIN - INPUT VALUE (ADD)
    Row[7] ECIN - INPUT VALUE (SUB) | TotalDownPaymentAmount = 900.00
    Row[8] ECIN - INPUT VALUE (SUB) | NetTradeAllowanceAmount = -600.00
    Row[9] ECIN - INPUT VALUE (SUB) | CashDownPayment = 100.00
    Row[10] ECIN - INPUT VALUE (SUB)     | OtherDownPaymentAmount = PATH DOES NOT EXIST
    Row[11] ECIN - INPUT VALUE (SUB) | ManufacturerRebateAmount = 250.00
    Row[12] ECIN - INPUT VALUE (SUB) | DeferredDownPaymentAmount = PATH DOES NOT EXIST
    Row[13] ECIN - INPUT VALUE (SUB)     
    Row[14]
    Row[15] ECOUT EXPECTED VALUE     900.00
    Row[16] ECOUT ACTUAL VALUE     900.00
    Row[17] RESULTS     PASS
    To perform one calculation there can be any no.of rows but columns are fixed i.e., column(0) & column(1). My calculation logic in java is as follows:
    import java.io.*;
    import org.apache.poi.ss.usermodel.Cell;
    import org.apache.poi.ss.usermodel.Row;
    import org.apache.poi.ss.usermodel.Sheet;
    import org.apache.poi.ss.usermodel.Workbook;
    import org.apache.poi.ss.usermodel.WorkbookFactory;
    public class ReadXlsxXls
    public static void main(String[] args) throws Exception, FileNotFoundException, IOException
              try
         Workbook workbook = WorkbookFactory.create(new FileInputStream("C:/Users/Pradeep.HALCYONTEKDC/Desktop/Excel.xlsx"));
         Sheet sheet = workbook.getSheet("ROLLUPS - Results");
         double summ = 0;
         double sub = 0;
         double result=0;
         for (int i = 0; i < sheet.getLastRowNum(); i++)
              Row row = sheet.getRow(i);
         Cell cell1 = row.getCell(0);
         Cell cell2 = row.getCell(1);
         if (cell1 != null && cell2 != null)
         String cellValue1 = cell1.getStringCellValue();
         String cellValue2 = cell2.getStringCellValue();
         if(cellValue2.contains("="))
         String stringNumber = cellValue2.split("=")[1].trim();
         if (cellValue1.contains("ADD"))
         if (cellValue2.split("=")[1].trim().contains("PATH DOES NOT EXIST"))
         //System.out.println("Path Does Not Exist");
         else
         //System.out.println(cellValue1 + "/" + stringNumber);
         summ = getSumm(summ, stringNumber);
         else if (cellValue1.contains("SUB"))
         if (cellValue2.split("=")[1].trim().contains("PATH DOES NOT EXIST"))
         //System.out.println("Path Does Not Exist");
         else
         //System.out.println(cellValue1 + "/" + stringNumber);
         sub = getSubstraction(sub, stringNumber);
         /* else
         System.out.println("Smt wrong");
         System.out.println("ADD = " + summ);
         System.out.println("SUB = " + sub);
         result=summ-sub;
         System.out.println("RESULT = " result"0");
         catch(NullPointerException e)
              e.printStackTrace();
         catch(Exception e)
              e.printStackTrace();
         private static double getSubstraction(double main, String your)
         if (your.contains("-"))
         return main + Double.parseDouble(your.replace("-", ""));
         else if (your.contains("+"))
         return main - Double.parseDouble(your.replace("+", ""));
         else
         return main - Double.parseDouble(your);
         private static double getSumm(double main, String your)
         if (your.contains("-"))
         return main - Double.parseDouble(your.replace("-", ""));
         else if (your.contains("+"))
         return main + Double.parseDouble(your.replace("+", ""));
         else
         return main + Double.parseDouble(your);
    Up to here fine. If there exists any more data in the rows after the row having cell value RESULTS like below, my program should perform the same logic repeatedly until it finds empty row. i.e., if program find empty row after RESULTS row stop the loop, else continue the loop to perform the no.of individual calculations.
    column(o) column(1)
    Row[0] ECOUT - EXPECTED VALUE | TotalDownPaymentAmount = 900.00
    Row[1] ECIN - INPUT VALUE (ADD) | NetTradeAllowanceAmount = -600.00
    Row[2] ECIN - INPUT VALUE (ADD) | CashDownPayment = 100.00
    Row[3] ECIN - INPUT VALUE (ADD) | OtherDownPaymentAmount = PATH DOES NOT EXIST
    Row[4] ECIN - INPUT VALUE (ADD) | ManufacturerRebateAmount = 250.00
    Row[5] ECIN - INPUT VALUE (ADD) | DeferredDownPaymentAmount = PATH DOES NOT EXIST
    Row[6] ECIN - INPUT VALUE (ADD)
    Row[7] ECIN - INPUT VALUE (SUB) | TotalDownPaymentAmount = 900.00
    Row[8] ECIN - INPUT VALUE (SUB) | NetTradeAllowanceAmount = -600.00
    Row[9] ECIN - INPUT VALUE (SUB) | CashDownPayment = 100.00
    Row[10] ECIN - INPUT VALUE (SUB)     | OtherDownPaymentAmount = PATH DOES NOT EXIST
    Row[11] ECIN - INPUT VALUE (SUB)     | ManufacturerRebateAmount = 250.00
    Row[12] ECIN - INPUT VALUE (SUB)     | DeferredDownPaymentAmount = PATH DOES NOT EXIST
    Row[13] ECIN - INPUT VALUE (SUB)     
    Row[14]
    Row[15] ECOUT EXPECTED VALUE     | 900.00
    Row[16] ECOUT ACTUAL VALUE     | 900.00
    Row[17] RESULTS     | PASS
    Row[18]
    Row[19] ECOUT - EXPECTED VALUE     | Amount = 1100.00
    Row[20] ECIN - INPUT VALUE (ADD)     | TradeAllowance = -300.00
    Row[21] ECIN - INPUT VALUE (ADD)     | Cash = 400.00
    Row[22] ECIN - INPUT VALUE (ADD)     | PaymentAmount = PATH DOES NOT EXIST
    Row[23] ECIN - INPUT VALUE (ADD)     | RebateAmount = 950.00
    Row[24] ECIN - INPUT VALUE (ADD)     | DownPaymentAmount = PATH DOES NOT EXIST
    Row[25] ECIN - INPUT VALUE (ADD)
    Row[26] ECIN - INPUT VALUE (SUB)     | Total = 900.00
    Row[27] ECIN - INPUT VALUE (SUB)     | NetAllowanceAmount = -600.00
    Row[28] ECIN - INPUT VALUE (SUB)     | CashPayment = 100.00
    Row[29] ECIN - INPUT VALUE (SUB)     | OtherAmount = PATH DOES NOT EXIST
    Row[30] ECIN - INPUT VALUE (SUB)     | RebateAmount = 250.00
    Row[31] ECIN - INPUT VALUE (SUB) |      DownPaymentAmount = PATH DOES NOT EXIST
    Row[32] ECIN - INPUT VALUE (SUB)     
    Row[33]
    Row[34] ECOUT EXPECTED VALUE     | 440.00
    Row[35] ECOUT ACTUAL VALUE     | 320.00
    Row[36] RESULTS     | FAIL
    Row[37]
    Row[38] ECOUT - EXPECTED VALUE     | Bell = 200.00
    Row[39] ECIN - INPUT VALUE (ADD)     | Charges = -700.00
    Row[40] ECIN - INPUT VALUE (ADD)     | Expenses = PATH DOES NOT EXIST
    Row[41] ECIN - INPUT VALUE (ADD)
    Row[42] ECIN - INPUT VALUE (SUB)     | Cosmetics = 300.00
    Row[43] ECIN - INPUT VALUE (SUB)     | Allowances = -100.00
    Row[44] ECIN - INPUT VALUE (SUB)     | CashPayment = 500.00
    Row[45] ECIN - INPUT VALUE (SUB)     
    Row[46]
    Row[47] ECOUT EXPECTED VALUE     | 640.00
    Row[48] ECOUT ACTUAL VALUE     | 720.00
    Row[49] RESULTS     | FAIL
    I could able to write the logic for one calculation, but I don't have any idea to use the same logic to perform no.of times for no.of calculations if there exists any more rows after the row RESULTS.Please help me in this case.
    If my requirement is not clear, please let me know. Thank you.
    Edited by: 1002444 on Apr 25, 2013 11:20 PM

    I have a requirement to perform some calculations using java taking inputs from Excel file.
    My Excel file content is as follows:
    Row[0] ECOUT - EXPECTED VALUE | TotalDownPaymentAmount = 900.00
    Row[1] ECIN - INPUT VALUE (ADD)     | NetTradeAllowanceAmount = -600.00
    Row[2] ECIN - INPUT VALUE (ADD) | CashDownPayment = 100.00
    Row[3] ECIN - INPUT VALUE (ADD)     | OtherDownPaymentAmount = PATH DOES NOT EXIST
    Row[4] ECIN - INPUT VALUE (ADD) | ManufacturerRebateAmount = 250.00
    Row[5] ECIN - INPUT VALUE (ADD) | DeferredDownPaymentAmount = PATH DOES NOT EXIST
    Row[6] ECIN - INPUT VALUE (ADD)
    Row[7] ECIN - INPUT VALUE (SUB) | TotalDownPaymentAmount = 900.00
    Row[8] ECIN - INPUT VALUE (SUB) | NetTradeAllowanceAmount = -600.00
    Row[9] ECIN - INPUT VALUE (SUB) | CashDownPayment = 100.00
    Row[10] ECIN - INPUT VALUE (SUB)     | OtherDownPaymentAmount = PATH DOES NOT EXIST
    Row[11] ECIN - INPUT VALUE (SUB) | ManufacturerRebateAmount = 250.00
    Row[12] ECIN - INPUT VALUE (SUB) | DeferredDownPaymentAmount = PATH DOES NOT EXIST
    Row[13] ECIN - INPUT VALUE (SUB)     
    Row[14]
    Row[15] ECOUT EXPECTED VALUE     900.00
    Row[16] ECOUT ACTUAL VALUE     900.00
    Row[17] RESULTS     PASS
    To perform one calculation there can be any no.of rows but columns are fixed i.e., column(0) & column(1). My calculation logic in java is as follows:
    import java.io.*;
    import org.apache.poi.ss.usermodel.Cell;
    import org.apache.poi.ss.usermodel.Row;
    import org.apache.poi.ss.usermodel.Sheet;
    import org.apache.poi.ss.usermodel.Workbook;
    import org.apache.poi.ss.usermodel.WorkbookFactory;
    public class ReadXlsxXls
    public static void main(String[] args) throws Exception, FileNotFoundException, IOException
              try
         Workbook workbook = WorkbookFactory.create(new FileInputStream("C:/Users/Pradeep.HALCYONTEKDC/Desktop/Excel.xlsx"));
         Sheet sheet = workbook.getSheet("ROLLUPS - Results");
         double summ = 0;
         double sub = 0;
         double result=0;
         for (int i = 0; i < sheet.getLastRowNum(); i++)
              Row row = sheet.getRow(i);
         Cell cell1 = row.getCell(0);
         Cell cell2 = row.getCell(1);
         if (cell1 != null && cell2 != null)
         String cellValue1 = cell1.getStringCellValue();
         String cellValue2 = cell2.getStringCellValue();
         if(cellValue2.contains("="))
         String stringNumber = cellValue2.split("=")[1].trim();
         if (cellValue1.contains("ADD"))
         if (cellValue2.split("=")[1].trim().contains("PATH DOES NOT EXIST"))
         //System.out.println("Path Does Not Exist");
         else
         //System.out.println(cellValue1 + "/" + stringNumber);
         summ = getSumm(summ, stringNumber);
         else if (cellValue1.contains("SUB"))
         if (cellValue2.split("=")[1].trim().contains("PATH DOES NOT EXIST"))
         //System.out.println("Path Does Not Exist");
         else
         //System.out.println(cellValue1 + "/" + stringNumber);
         sub = getSubstraction(sub, stringNumber);
         /* else
         System.out.println("Smt wrong");
         System.out.println("ADD = " + summ);
         System.out.println("SUB = " + sub);
         result=summ-sub;
         System.out.println("RESULT = " result"0");
         catch(NullPointerException e)
              e.printStackTrace();
         catch(Exception e)
              e.printStackTrace();
         private static double getSubstraction(double main, String your)
         if (your.contains("-"))
         return main + Double.parseDouble(your.replace("-", ""));
         else if (your.contains("+"))
         return main - Double.parseDouble(your.replace("+", ""));
         else
         return main - Double.parseDouble(your);
         private static double getSumm(double main, String your)
         if (your.contains("-"))
         return main - Double.parseDouble(your.replace("-", ""));
         else if (your.contains("+"))
         return main + Double.parseDouble(your.replace("+", ""));
         else
         return main + Double.parseDouble(your);
    Up to here fine. If there exists any more data in the rows after the row having cell value RESULTS like below, my program should perform the same logic repeatedly until it finds empty row. i.e., if program find empty row after RESULTS row stop the loop, else continue the loop to perform the no.of individual calculations.
    column(o) column(1)
    Row[0] ECOUT - EXPECTED VALUE | TotalDownPaymentAmount = 900.00
    Row[1] ECIN - INPUT VALUE (ADD) | NetTradeAllowanceAmount = -600.00
    Row[2] ECIN - INPUT VALUE (ADD) | CashDownPayment = 100.00
    Row[3] ECIN - INPUT VALUE (ADD) | OtherDownPaymentAmount = PATH DOES NOT EXIST
    Row[4] ECIN - INPUT VALUE (ADD) | ManufacturerRebateAmount = 250.00
    Row[5] ECIN - INPUT VALUE (ADD) | DeferredDownPaymentAmount = PATH DOES NOT EXIST
    Row[6] ECIN - INPUT VALUE (ADD)
    Row[7] ECIN - INPUT VALUE (SUB) | TotalDownPaymentAmount = 900.00
    Row[8] ECIN - INPUT VALUE (SUB) | NetTradeAllowanceAmount = -600.00
    Row[9] ECIN - INPUT VALUE (SUB) | CashDownPayment = 100.00
    Row[10] ECIN - INPUT VALUE (SUB)     | OtherDownPaymentAmount = PATH DOES NOT EXIST
    Row[11] ECIN - INPUT VALUE (SUB)     | ManufacturerRebateAmount = 250.00
    Row[12] ECIN - INPUT VALUE (SUB)     | DeferredDownPaymentAmount = PATH DOES NOT EXIST
    Row[13] ECIN - INPUT VALUE (SUB)     
    Row[14]
    Row[15] ECOUT EXPECTED VALUE     | 900.00
    Row[16] ECOUT ACTUAL VALUE     | 900.00
    Row[17] RESULTS     | PASS
    Row[18]
    Row[19] ECOUT - EXPECTED VALUE     | Amount = 1100.00
    Row[20] ECIN - INPUT VALUE (ADD)     | TradeAllowance = -300.00
    Row[21] ECIN - INPUT VALUE (ADD)     | Cash = 400.00
    Row[22] ECIN - INPUT VALUE (ADD)     | PaymentAmount = PATH DOES NOT EXIST
    Row[23] ECIN - INPUT VALUE (ADD)     | RebateAmount = 950.00
    Row[24] ECIN - INPUT VALUE (ADD)     | DownPaymentAmount = PATH DOES NOT EXIST
    Row[25] ECIN - INPUT VALUE (ADD)
    Row[26] ECIN - INPUT VALUE (SUB)     | Total = 900.00
    Row[27] ECIN - INPUT VALUE (SUB)     | NetAllowanceAmount = -600.00
    Row[28] ECIN - INPUT VALUE (SUB)     | CashPayment = 100.00
    Row[29] ECIN - INPUT VALUE (SUB)     | OtherAmount = PATH DOES NOT EXIST
    Row[30] ECIN - INPUT VALUE (SUB)     | RebateAmount = 250.00
    Row[31] ECIN - INPUT VALUE (SUB) |      DownPaymentAmount = PATH DOES NOT EXIST
    Row[32] ECIN - INPUT VALUE (SUB)     
    Row[33]
    Row[34] ECOUT EXPECTED VALUE     | 440.00
    Row[35] ECOUT ACTUAL VALUE     | 320.00
    Row[36] RESULTS     | FAIL
    Row[37]
    Row[38] ECOUT - EXPECTED VALUE     | Bell = 200.00
    Row[39] ECIN - INPUT VALUE (ADD)     | Charges = -700.00
    Row[40] ECIN - INPUT VALUE (ADD)     | Expenses = PATH DOES NOT EXIST
    Row[41] ECIN - INPUT VALUE (ADD)
    Row[42] ECIN - INPUT VALUE (SUB)     | Cosmetics = 300.00
    Row[43] ECIN - INPUT VALUE (SUB)     | Allowances = -100.00
    Row[44] ECIN - INPUT VALUE (SUB)     | CashPayment = 500.00
    Row[45] ECIN - INPUT VALUE (SUB)     
    Row[46]
    Row[47] ECOUT EXPECTED VALUE     | 640.00
    Row[48] ECOUT ACTUAL VALUE     | 720.00
    Row[49] RESULTS     | FAIL
    I could able to write the logic for one calculation, but I don't have any idea to use the same logic to perform no.of times for no.of calculations if there exists any more rows after the row RESULTS.Please help me in this case.
    If my requirement is not clear, please let me know. Thank you.
    Edited by: 1002444 on Apr 25, 2013 11:20 PM

  • How to call function in included dll file through java application.

    Hi All,
    i am trying to create an java application which call c# functions using JNI. i am completed with the code and it is running fine when i tried to run from netbeans IDE. But when i tried from Calculator.jar file, first time it throws this error:
    F:\JavaProjects\Calculator\dist>Java -jar Calculator.jar
    Exception in thread "main" java.lang.UnsatisfiedLinkError: no CSharpClient in java.library.path
    at java.lang.ClassLoader.loadLibrary(Unknown Source)
    at java.lang.Runtime.loadLibrary0(Unknown Source)
    at java.lang.System.loadLibrary(Unknown Source)
    at calculator.CalculatorApp.<clinit>(CalculatorApp.java:20)
    After that i included that dll file in the cuurent directory. And compiled and tried to run, it throws an unexpected error:
    F:\JavaProjects\Calculator\dist>Java -jar Calculator.jar
    *# An unexpected error has been detected by Java Runtime Environment:*
    *# Internal Error (0xe0434f4d), pid=2640, tid=3700*
    *# Java VM: Java HotSpot(TM) Client VM (1.6.0_02-b06 mixed mode, sharing)*
    *# Problematic frame:*
    *# C [kernel32.dll+0x12a5b]*
    *# An error report file with more information is saved as hs_err_pid2640.log*
    *# If you would like to submit a bug report, please visit:*
    *# http://java.sun.com/webapps/bugreport/crash.jsp*
    Anyone have idea how to solve this error.
    Thanks in advance.

    This error is created whenever things go sour on the native side. The first thing you can try, and I assume you are using a Java<->C++<->C# bridge which includes two dlls, one created by C++ and another by C#. Is to make sure that the C# dll is compiled using /t:module switch during compilation.
    If you are using VS2008, or VS2005, you can add a post build syntax like:
    csc /t:module /out:"$(ProjectDir)$(OutDir)YourModule.dll" "$(ProjectDir)YourCSfile.cs"
    Hope this helps! If not, ensure first that the native code works by creating a native test app for it.

  • URGENT Help With Scientific Calculator!

    Hi everybody,
    I designed a calculator, and I need help with the rest of the actions. I know I need to use the different Math methods, but I tried tried that and it didn't work. Also, it needs to work as an applet and application, and in the applet, the buttons don't appear in order, how can I fix that?
    I will really appreciate your help with this program, I can't get it to work and I'm frustrated, I need to finish this for next Tuesday 16th. Please e-mail me at [email protected].
    Below is the code for the calcualtor.
    Thanks a lot!
    -Maria
    // calculator
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.border.*;
    public class calculator extends JApplet implements
    ActionListener
      private JButton one, two, three, four, five, six, seven,
      eight, nine, zero, dec, eq, plus, minus, mult, div, clear,
      mem, mrc, sin, cos, tan, asin, acos, atan, x2, sqrt, exp, pi, percent;
      private JLabel output, blank;
      private Container container;
      private String operation;
      private double number1, number2, result;
      private boolean clear = false;
      //GUI
      public void init()
        container = getContentPane();
        //Title
        //super("Calculator");
        JPanel container = new JPanel();     
        container.setLayout( new FlowLayout( FlowLayout.CENTER
        output = new JLabel("");     
        output.setBorder(new MatteBorder(2,2,2,2,Color.gray));
        output.setPreferredSize(new Dimension(1,26));     
        getContentPane().setBackground(Color.white);     
        getContentPane().add( "North",output );     
        getContentPane().add( "Center",container );
        //blank
        blank = new JLabel( "                    " );
        container.add( blank );
        //clear
        clear = new JButton( "CE" );
        clear.addActionListener(this);
        container.add( clear );
        //seven
        seven = new JButton( "7" );
        seven.addActionListener(this);
        container.add( seven );
        //eight
        eight = new JButton( "8" );
        eight.addActionListener(this);
        container.add( eight );
        //nine
        nine = new JButton( "9" );
        nine.addActionListener(this);
        container.add( nine );
        //div
        div = new JButton( "/" );
        div.addActionListener(this);
        container.add( div );
        //four
        four = new JButton( "4" );
        four.addActionListener(this);
        container.add( four );
        //five
        five = new JButton( "5" );
        five.addActionListener(this);
        container.add( five );
        //six
        six = new JButton( "6" );
        six.addActionListener(this);
        container.add( six );
        //mult
        mult = new JButton( "*" );
        mult.addActionListener(this);
        container.add( mult );
        //one
        one = new JButton( "1" );
        one.addActionListener(this);
        container.add( one );
        //two
        two = new JButton( "2" );
        two.addActionListener(this);
        container.add( two );
        //three
        three = new JButton( "3" );
        three.addActionListener(this);
        container.add( three );
        //minus
        minus = new JButton( "-" );
        minus.addActionListener(this);
        container.add( minus );
        //zero
        zero = new JButton( "0" );
        zero.addActionListener(this);
        container.add( zero );
        //dec
        dec = new JButton( "." );
        dec.addActionListener(this);
        container.add( dec );
        //plus
        plus = new JButton( "+" );
        plus.addActionListener(this);
        container.add( plus );
        //mem
        mem = new JButton( "MEM" );
        mem.addActionListener(this);
        container.add( mem );   
        //mrc
        mrc = new JButton( "MRC" );
        mrc.addActionListener(this);
        container.add( mrc );
        //sin
        sin = new JButton( "SIN" );
        sin.addActionListener(this);
        container.add( sin );
        //cos
        cos = new JButton( "COS" );
        cos.addActionListener(this);
        container.add( cos );
        //tan
        tan = new JButton( "TAN" );
        tan.addActionListener(this);
        container.add( tan );
        //asin
        asin = new JButton( "ASIN" );
        asin.addActionListener(this);
        container.add( asin );
        //acos
        acos = new JButton( "ACOS" );
        cos.addActionListener(this);
        container.add( cos );
        //atan
        atan = new JButton( "ATAN" );
        atan.addActionListener(this);
        container.add( atan );
        //x2
        x2 = new JButton( "X2" );
        x2.addActionListener(this);
        container.add( x2 );
        //sqrt
        sqrt = new JButton( "SQRT" );
        sqrt.addActionListener(this);
        container.add( sqrt );
        //exp
        exp = new JButton( "EXP" );
        exp.addActionListener(this);
        container.add( exp );
        //pi
        pi = new JButton( "PI" );
        pi.addActionListener(this);
        container.add( pi );
        //percent
        percent = new JButton( "%" );
        percent.addActionListener(this);
        container.add( percent );
        //eq
        eq = new JButton( "=" );
        eq.addActionListener(this);
        container.add( eq );
        //Set size and visible
        setSize( 190, 285 );
        setVisible( true );
    public static void main(String args[]){
        //execute applet as application
         //applet's window
         JFrame applicationWindow = new JFrame("calculator");
    applicationWindow.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
         //applet instance
         calculator appletObject = new calculator();
         //init and start methods
         appletObject.init();
         appletObject.start();
      } // end main
      public void actionPerformed(ActionEvent ae)
        JButton but = ( JButton )ae.getSource();     
        //dec action
        if( but.getText() == "." )
          //if dec is pressed, first check to make shure there
    is not already a decimal
          String temp = output.getText();
          if( temp.indexOf( '.' ) == -1 )
            output.setText( output.getText() + but.getText() );
        //clear action
        else if( but.getText() == "CE" )
          output.setText( "" );
          operation = "";
          number1 = 0.0;
          number2 = 0.0;
        //plus action
        else if( but.getText() == "+" )
          operation = "+";
          number1 = Double.parseDouble( output.getText() );
          clear = true;
          //output.setText( "" );
        //minus action
        else if( but.getText() == "-" )
          operation = "-";
          number1 = Double.parseDouble( output.getText() );
          clear = true;
          //output.setText( "" );
        //mult action
        else if( but.getText() == "*" )
          operation = "*";
          number1 = Double.parseDouble( output.getText() );
          clear = true;
          //output.setText( "" );
        //div action
        else if( but.getText() == "/" )
          operation = "/";
          number1 = Double.parseDouble( output.getText() );
          clear = true;
          //output.setText( "" );
        //eq action
        else if( but.getText() == "=" )
          number2 = Double.parseDouble( output.getText() );
          if( operation == "+" )
            result = number1 + number2;
          else if( operation == "-" )
            result = number1 - number2;
          else if( operation == "*" )
            result = number1 * number2;
          else if( operation == "/" )
            result = number1 / number2;       
          //output result
          output.setText( String.valueOf( result ) );
          clear = true;
          operation = "";
        //default action
        else
          if( clear == true )
            output.setText( "" );
            clear = false;
          output.setText( output.getText() + but.getText() );
    }

    Multiple post:
    http://forum.java.sun.com/thread.jsp?forum=31&thread=474370&tstart=0&trange=30

  • How to display value from java class with output generated with toplink

    i hava a requirement of displaying (distance ie calculated in java class) with output generated by query.
    ie if output is like
    school name (distance)
    physical address
    here the school name and physical address are retrived from database.

    Hi,
    ValueHolders are used by the JSF internal framework. To work with an object (attributes) in a managed bean you don't need to make it returning a value holder.
    Create a POJO, provide accessor methods and register it as a managed bean. Access it from JSF with EL
    Frank

  • "java.lang.ClassNotFoundException" when creating a CFC instance inside a webservice

    This question is also up on stack overflow: http://stackoverflow.com/questions/10089962/coldfusion-web-service-failing-to-see-componen t
    I've got a CFC that I'm going to access with ?wsdl as a SOAP webservice.
    If I call the CFC directly in a browser, my results render fine:
        http://server/webservice/calc.cfc?method=doStuff&foo=bar
    If I try to access it as a web service:
        ws = CreateObject("webservice", 'http://server/webservice/calc.cfc?wsdl');
        result = ws.doStuff('bar');
    I get an error:
    Cannot perform web service invocation doStuff.
    The fault returned when invoking the web service operation is:
    AxisFault
    faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
    faultSubcode:
    faultString: coldfusion.xml.rpc.CFCInvocationException:
    [coldfusion.xml.rpc.CFCInvocationException : [java.lang.ClassNotFoundException :
    com.calculations.calc][java.lang.NullPointerException : null]]
    faultActor:
    faultNode:
    faultDetail:
        {http://xml.apache.org/axis/}stackTrace:coldfusion.xml.rpc.CFCInvocationException:          [coldfusion.xml.rpc.CFCInvocationException : [java.lang.ClassNotFoundException :    
    com.calculations.calc][java.lang.NullPointerException : null]]
        at     coldfusion.xml.rpc.CFComponentSkeleton.__createCFCInvocationException(CFComponentSkeleton.java:733)
        at coldfusion.xml.rpc.CFComponentSkeleton.__convertOut(CFComponentSkeleton.java:359)
        at webservice.calc.doStuff(/var/www/vhosts/server/httpdocs/webservice/calc.cfc)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.r... ''
    The problem is because the doStuff function is declaring an instance of a CFC inside it:
    remote struct function doStuff(foo) {
      var objReturn = {};
        objReturn.msg = 'A message';
        // do a calculation
        var objCalc = new com.calculations.calc(foo);
        objReturn.calc = objCalc;
      return objReturn;
    So my CFC that I'm using as a webservice has got another CFC being declared inside a function. Browsing directly to my webservice CFC works fine, but trying to call it using the CreateObject/webservice route fails, as it can't create an instance of the **com.calculations.calc** component.
    It doesn't error, wierdly, if I comment out the objReturn.calc = objCalc line. So it seems I can create the instance, but the error isn't thrown till I assign it to my return struct.
    Also I've found, If I refresh the page a few times, sometimes the error changes to:
    AxisFault
    faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
    faultSubcode:
    faultString: coldfusion.xml.rpc.CFCInvocationException:
        [coldfusion.xml.rpc.CFCInvocationException : [java.lang.ClassNotFoundException :    
        com.calculations.calc][coldfusion.xml.rpc.CFCInvocationException :
        returnType must     be defined for remote CFC functions.]]
         faultActor:
         faultNode:
         faultDetail:
        {http://xml.apache.org/axis/}stackTrace:coldfusion.xml.rpc.CFCInvocationException:
        [coldfusion.xml.rpc.CFCInvocationException : [java.lang.ClassNotFoundException :
        com.calculations.calc][coldfusion.xml.rpc.CFCInvocationException :
        returnType must be defined for remote CFC functions.]]
        at coldfusion.xml.rpc.CFComponentSkeleton.__createCFCInvocationException(CFComponentSkeleton.java:733)
    at coldfusion.xml.rpc.CFComponentSkeleton.__convertOut(CFComponentSkeleton.java:359)
    at webservices.TaxCalc.feed.getTaxCalc(/var/www/vhosts/server/httpdocs/webservice/calc.cfc)
    at sun.reflect.Nat... ''
    Message was edited by: PeteComcar - impvoed code formatting and added returntype update

    Dear All Technology Expert's,
    I have a query related to Coldfusion SOAP services, that is most commonly asked in all the forum's but NONE of them has got answer.
    If there is NO solution so I think Adobe has to come up with some patches so developer can able to do some customization.
    I like to share with you all, in all other language ( PHP, JAVA, .NET etc) this option is available and you can customize the error.
    Ok let me again explain the very basic error:
    SOAP Request:
    <soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
       <soapenv:Header/>
       <soapenv:Body>
       </soapenv:Body>
    </soapenv:Envelope>
    SOAP Response:
      <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
       <soapenv:Body>
          <soapenv:Fault>
             <faultcode>soapenv:Server.userException</faultcode>
             <faultstring>java.lang.Exception: Body not found.</faultstring>
             <detail>
                <ns1:stackTrace xmlns:ns1="http://xml.apache.org/axis/">java.lang.Exception: Body not found.
      at org.apache.axis.providers.java.RPCProvider.processMessage(RPCProvider.java:121)...</ns1:s tackTrace>
                <ns2:hostname xmlns:ns2="http://xml.apache.org/axis/">Coldfusion Error</ns2:hostname>
             </detail>
          </soapenv:Fault>
       </soapenv:Body>
    </soapenv:Envelope>
    HOW we can customize the error, in all other languages you can simple customize the error like
    Other languages SOAP response:
      <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
       <soapenv:Body>
          <soapenv:Fault>
             <faultcode>BODY_NOT_FOUND</faultcode>
             <faultstring>Body is missing in your request</faultstring>
          </soapenv:Fault>
       </soapenv:Body>
    </soapenv:Envelope>
    But the same is NOT possible in Coldfusion, right?
    AS you know it is vulnerability to display exception messages in the response.
    We are developing this web service to access  from other language website (PHP, .NET).
    We are also planning to upgrade server the Coldfusion 11, but do you think there is any solution with latest Coldfusion version.
    Please response only if you know about these issue's or solution. 
    Thanks
    Niyaz

  • Dilution of Precision in Java?

    Hi everyone! I'm new to Java and I was wondering if anyone knew if anyone has accomplished a DOP or GDOP calculation in Java.
    I've been monkeying around with arrays and some low-level matrix stuff. And, Wikipedia has an "equation", but, I dunno how to literally translate an equation into Java just yet.
    There used to be some Matlab source on the Inertnet via Google searches but the pages have expired. If I were to get ahold of some Matlab source, is it hard to convert over to Java?
    Thanks!
    George

    817410 wrote:
    There used to be some Matlab source on the Inertnet
    Inertnet - gotta love that...
    via Google searches but the pages have expired.
    If I were to get hold of some Matlab source, is it hard to convert over to Java?Google ( [url http://www.google.com/search?q=matlab+java]matlab java ).

  • Calculator using swing

    hello everyone,
    I am new toprogramming and alst to java language. can anybody help me in writing calculator using java swing.
    the functionality of the calculator should be same as the one we use in windows operating system
    please help me

    please help meSure, what problem to you have?
    if you are starting from scratch, get a copy of this book
    http://www.amazon.com/gp/product/1931841608/qid=1144486744/sr=2-1/ref=pd_bbs_b_2_1/002-4043290-4676869?s=books&v=glance&n=283155
    which builds a calculator throughout the book

  • PR routine java conversion

    Hi,
    I need to convert PR user exit for excise calculation to java.I hava read note 809820 but still hava many doubts:
    1. how to handle select and read statements? As mentioned in note, JCO calls or JDBC connection can not be used.
    2. I can not find API methods for settings excise. how to set excise?
    3. For structures/tables such as J_1IINDCUS, j_1itaxvar corrosponding java APIs are not available. What can be done in this case?
    Regards,
    Apurva

    Hi,
    Two more dobts
    1. I understand that BADI - CRM_COND_COM_BADI is used for communication between ABAP and JAVA.But is it called before executing java code or after java code execution? Can I use this BADI for filling up input fields for JAVA routine or for getting values returned from java routine (by item.dynamicValueReturn)?
    2.I know that there will be performance impact, if I use database.db_read_table for select queries.There are around 25 select queries in my ABAP routine. so, what is the other way of handling these select queries?
    Please help.
    Regards,
    Apurva

  • Need Java Help on a Mortgage program

    I keep getting the following error.
    java:20: illegal start of expression
    public Scanner myScanner = new Scanner(System.in);
    /*Danielle Safonte*/
    /* Week 2 Mortgage Calculator*/
    import java.util.Scanner;
    import java.io.*;
    import java.text.*;
    public class Week2Assignment
    int principle = 200000;
    float interest = .0575;
    int term = 30;
    int months;
    float paymentdue;
    float calculation;
    public static void months()
    public Scanner myScanner = new Scanner(System.in);
    System.out.print("What month of the loan is this?" + months);
    if (months = term) {
    System.out.print("You have paid off your loan");
    else
         months = myScanner.next();
         float Jinterest = (interest / (months*100));
         calculation = principle * (Jinterest/(1-(1+Jinterest)^(-months))); /*Monthly payment*/
         float Minterest = principle * Jinterest; /*This months interest*/
         float Mprinciple = calculation - Minterest; /*This months principle*/
         float newBalance = principle - Mprinciple; /*This calculates the new principle*/
         if (newBalance = princple) {
              System.out.print("You have paid off your loan");
         else
              System.out.print("This months payment is: $", calculation); /*Displays the current months payment*/
              System.out.print("You have $", newBalance," left on your loan"); /*Displays the new principle balance*/
              System.out.print("This months principle is: $", Mprinciple ); /*Displays the new principle balance*/
    }

    It is in my post at 10:02, but here it is again:
    These are the errors that I am left with. I worked through the rest.
    .java:29: '.class' expected
    months = myScanner.next(int);
    ^
    .java:29: ')' expected
    months = myScanner.next(int);
    ^
    2 errors
    Tool completed with exit code 1
    import java.util.Scanner;
    import java.io.*;
    import java.text.*;
    public class Week2Assignment
    int principle = 200000;
    double  interest = .0575;
    int term = 30;
    int months;
    float paymentdue;
    float calculation;
    public void months()
    Scanner myScanner = new Scanner(System.in);
       System.out.print("What month of the loan is this?" + months);
    if (months == term) {
       System.out.print("You have paid off your loan");
    else
         months = myScanner.next(int);
         double Jinterest = (interest / (months*100));
         calculation = principle * (Jinterest/(1-(1+Jinterest)^(-months))); /*Monthly payment*/
         float Minterest = principle * Jinterest; /*This months interest*/
         float Mprinciple = calculation - Minterest; /*This months principle*/
         float newBalance = principle - Mprinciple; /*This calculates the new principle*/
         if (newBalance == princple) {
                 System.out.print("You have paid off your loan");
         else
                 System.out.print("This months payment is: $", calculation); /*Displays the current months payment*/
                 System.out.print("You have $", newBalance," left on your loan"); /*Displays the new principle balance*/
                 System.out.print("This months principle is: $", Mprinciple ); /*Displays the new principle balance*/
    }

Maybe you are looking for

  • Issue with drill down in Financial Reporting 11.1.2.2

    Hi All, I have a requirement like this : I have different dimensions for Year and Period(Period has half years and also quarters ). The requirement is like that when the report opens up the rport should look like this:                          YearTo

  • Output results to more columns...

    Hi! I have problem, for which I didn't find solution yet. I have query and this query returns the unknown count of rows (this row count is unknown in time of developing). I would like output results of this query to more than one result column to the

  • Connecting to SAP using JCO: Difference between SAP AS 7.3 & Other Servers

    Hi All, I am connecting to SAP system using jar sapjco3. I am able to connect to SAP system successfully. But I observed some difference in connection to SAP system between different servers. 1. Using TOMCAT  6 and JBOSS 5.1 While connection, when I

  • Ignore !DOCTYPE DTD Link

    I want to Check in XML Files that have been created with an editor and validated against a DTD. Here my Question: Is it possible to tell the SimpleXMLParser to ignore the <!DOCTYPE ... Reference, since it isn't able to validate against the DTD that i

  • There is a friends on chat window on Fcebook home page that is missing. Where is it and how can I get I back?

    On the home page in Facebook, on the bottom of the left hand corner there is supposed to be a friends on chat window that shows green dots and pictures of my friends that are on chat. Mine is no longer there and i was hoping that you can help me in f