Math error

Here is my program. It is a simple additon. I thought the trouble was i converting from strings to doubles and back again but narrowing it down I found this. When I run this program the answer I get is
519.3199999999999
and I believe it should be 519.32
Why is this happening? I want to write a simple calculator to figure simple arithmetic but these errors are unacceptable.
import java.awt.*;
public class Addition {
     double acc1;
     double acc2;
     double answer;
public Addition() {
     acc1 = 517.17;
acc2 = 2.15;
answer = acc1 + acc2;
System.out.println(answer);
public static void main(String[] arguments) {
Addition ad = new Addition();
}

I will leave you to figure the rest out (as you seem to like my sense of humour - you're quite exceptional really ...) but here's a little push;-java.text.DecimalFormat df = new java.text.DecimalFormat("0.00"); // should be enough
System.out.println("The result is " + df.format(answer));have a nice day!
Sue xxx

Similar Messages

  • Offset path has a math error at 4 decimal places

    I have Illustrator CC 2014 running in Mac OS X 10.9.3, and discovered tonight while making a test pattern that if I do an offset path of -0.0005" it doesn't calculate the size of the resulting objects correctly. If I do +0.0005" it works fine, if I do -0.0015" it works fine. I obviously haven't tested exhaustively, but there is definitely a reproducible error there. It's not even off consistently in the width and height. The sizes listed refer to the size of the individual squares in the 4x4 grid of filled rectangles.

    The black squares are what I'm building. So I didn't have to go one by one and apply offset path, I did three across and then noted that the next row above would be .003 difference, so I could apply a .0015 offset to all items in the row and move it up, then repeat. This works well for a while, but then it starts to get off. It doesn't appear to be cumulative which was my fear. The black squares I checked each one and redid them if they didn't come out right. The blue ones I just did an offset from the previous row. At .015 it should be .065x.065 and they are .065x.0649. That's the behavior I normally see, not a big deal. In that group, all 16 squares were the same, but in the .018 group above it, the first two rows of 4 were .062x.0619 while the 3rd row of 4 were all .062x.062 and then the top row were off again. By the top, the ones that are off are still only off by .0001 when they are off. So that implies that this is at least a rendering thing, it thinks the squares are what they are supposed to be when it applies future offsets.
    I'm not sure if my original example is the same though. That was off by .001 in one direction and .0005 in the other which is 5-10X more than these. These are the issue I've always seen that at 1/10,000th of an inch are tiny differences and not really important for what we do. The one I started this thread about is much bigger and a definite problem. I'll post my latest test on that separately.

  • Java (maths) error? How to solve?

    Hi, here is some of my code,
    public static void main(String [] args)
    int num1;
    int num2;
    int num3;
    num1 = 3;
    num2 = 3;
    num3 = 3;
    if ((num1 == num2) && (num1 == num3))
    System.out.println("Your triangle is equalateral, all sides are the same length!");
    if (((num1 == num2) && (num1 != num3)) || ((num1 == num3) && (num1 != num2)) || ((num2 == num3) && (num2 != num1)));
    System.out.println("Your triangle is isosceles, two sides are the same length!");
    if ((num1 != num2) && (num1 != num3) && (num2 != num3));
    System.out.println ("Your triangle is scalene, no sides are the same length!");
    if ((((num1 num2)<num3) || ((num2 num3)<num1) || ((num1 num3)<num2)));
    System.out.println ("Your 'triangle' isn't a triangle!");
    I keep getting error with just this 1 line?
    if ((((num1 num2)<num3) || ((num2 num3)<num1) || ((num1 num3)<num2)));
    I do not know why, JavaBeans says "illegal start of expression"
    Please can someone help? Thank you.

    FYI another way to write this could be:
    int equalsSides = (num1 == num2 ? 1 : 0) +
            (num1 == num3 ? 1 : 0) +
            (num2 == num3 ? 1 : 0);
    switch (equalsSides) {
        case 3:
            System.out.println("Your triangle is equilateral, all sides are the same length!");
            break;
        case 2:
            System.out.println("Your triangle is isosceles, two sides are the same length!");
            break;
        default:
            System.out.println("Your triangle is scalene, no sides are the same length!");
    }

  • Maths Error

    I am trying to compute the value of a Bernoulli shift, so the equation is of the form:
    x' = Ax + B;
    So I'v stored everything as doubles but when I use values A = 1, B = -1.0 and x is at 1.92 (for example):
    x' = (1) * 1.92 - 1.0;
    gives me x' = 0.91999999999..
    After 100 or so iterations the size of this error becomes huge. I realise this is a rounding off error but does anyone know a way around this? Here is some code to illustrate it..
    class test {
    public static void main(String[] args){
    double tester1 = 1.92 - 1.0;
    System.out.println("1.92 - 1.0 : " + tester1);
    I know I could change the whole system to use rational numbers but it would be difficult at this point. Thanks in advance.

    a double has 64 bits, some are used for the sign, some for the exponent, some for the mantissa.
    There are some numbers that can not be stored exactly as a binary number (for a similar feature, try to write out 2/3 in decimal representation: 0.66666....667 is not exact).
    If you care about the precision use BigDecimal, but I would recomend that you do check what error you get when using doubles.

  • Php mysql math error when using format(somenumber,2)

    osx 10.5.2, php 5.2.5, mysql 5.0.51 (standard leopard desktop os install)
    Select format(myField,2) as someNumber from myTable ...
    returns data i would expect, formatted as you would expect.
    while looping through the data returned i am calculating a running total.
    for numeric values less than 1,000 results are expected. for numbers gt 1000, php seems to want to truncate the value at the comma. 1,111.11 evaluates to 1; 25,000 evaluates to 25.
    If you remove the format() from the sql statement everything works the way you would expect.
    wrapping the value returned in a floatval() had no effect.
    I am posting this on the apple site rather than php/mysql forums on the off chance that this is a mac centric issue. googling the obvious combinations wasn't productive.

    Sounds like a locale issue.
    Many international formats use comma as the decimal separator, not the thousands.
    There are many levels where this could be set. It could be an OS setting (you don't say where you or, or the locale information of your machine (System Preferences -> International -> Format). It could be in PHP (see: http://www.php.net/setlocale ), or it could be in the database (data could be written in a comma-based table).
    It will take a little research to work out where your specific problem lies.

  • Converting chars to ints, get a strange math error...

    Here's the code I have.
    import java.util.*;
    public class Encryption {
         public static void main(String[] args) {
              Scanner sc1 = new Scanner(System.in);
              System.out.print("Enter a four-digit integer to be encrypted: ");
              String encrypt = sc1.nextLine();
              char a = encrypt.charAt(0);
              char b = encrypt.charAt(1);
              char c = encrypt.charAt(2);
              char d = encrypt.charAt(3);
              int as = new Integer(a).intValue();
              int bs = new Integer(b).intValue();
              int cs = new Integer(c).intValue();
              int ds = new Integer(d).intValue();
              int codea = (as + 7);
              while (codea > 9) {codea = codea - 10;}
              int codeb = (bs + 7);
              while (codeb > 9) {codeb = codeb - 10;}
              int codec = (cs + 7);
              while (codec > 9) {codec = codec - 10;}
              int coded = (ds + 7);
              while (coded > 9) {coded = coded - 10;}
              int finala = codec;
              int finalb = coded;
              int finalc = codea;
              int finald = codeb;
              String encrypted = ("" + finala + "" + finalb + "" + finalc + "" + finald + "");
              //System.out.println ("The encrypted number is " + encrypted + ""); set aside while debugging
              System.out.println(" " + a + " " + b + " " + c + " " + d + " ");
              System.out.println(" " + as + " " + bs + " " + cs + " " + ds + " ");
    }Now here's the console.
    Enter a four-digit integer to be encrypted: 1234
    1 2 3 4
    49 50 51 52
    When I went from char to int, 1 became 49, 2 became 50, etc...how did this happen?

    class Fubar1
        public static void main(String[] args)
            System.out.println("'1' = " + '1'); // prints the char
            System.out.println("(int)'1' = " + (int)'1'); // prints the ASCII (unicode?) number that represents that char
    }

  • User defined Error Codes

    Hello,
      I am using the "Bundle by Name" VI to insert error info into the Labview Error Cluster.   I am doing calculations and have assigned a -23096 to the error code and during program execution a dialog box pops up stating the following
    Possible reason(s):
    Analysis:  Too many decimal points.
    I am assuming the dialog box is being generated by the system because the -23096 is defined to in the the range for Math errors. So how do I defined my own error codes that Labview will not use and cause unexpected dialog boxes to appear. My approach to handing the errors is the I will check the error status flag and if the error is one of mine I will handle it.
    Regards,
    Kaspar
    Regards,
    Kaspar

    After rereading your last post I think I know what you are getting at. Here is how I create a custom error cluster.
    1.On your front panel lay down a "error in" control cluster found in 8.2.1 at Array Matrix and Cluster.
    2.Switch to your block diagram and right click this control and change it to a constant.
    3.Wire this constant into the top of a bundle by name function. Expand the bundle by name to show the 3 elements. For each element create a constant and enter your information. You can feed the output of this function to any error input of the following vi's or create an indicator and hook it to your front panel connector pane.
    Hope this helps
    Using LabVIEW 2010SP1 and TestStand 4.5

  • I'm trying to write a formula to return a blank cell if the condition is met, and to show the numerical difference if not.  Here is what I've written:=IF((F35-F29)=0, " ", (F35-F29)). It is returning 0.00, not a blank cell.  Where is my error?

    I'm trying to write a formula to return a blank cell if the condition is met, and to show the numerical difference if not.  Here is what I've written:=IF((F35-F29)=0, " ", (F35-F29)). When the condition is met (i.e., the difference=0) it is returning 0.00, not a blank cell.  Where is my error?

    Without knowing what is in F35 and F29, I can only guess.  Your formula matches what you said but if F35 and/or F29 are the results of formulas and are decimal numbers (not integers), it is very possible that they are not exactly the same number even though you think they should be.  IEEE Floating Point math often has very very small errors so the answer is not exactly what you would get with a pencil and paper. Try one or both of these things:
    Format the IF cell as scientific. is that 0.0 exactly zero? I suspect it will be some very tiny number.
    Type the exact same number into F35 and F29 and see if your IF formula works as you expect.
    You might need to use ROUND on F35, F29 and/or in your IF formula to get rid of the tiny math errors.
    If you search the forum for floating point math or IEEE 754 you should find more than a few posts about Numbers and floating point math. Or you can read about IEEE 754 on Wikipedia.  It trips up a lot of people.
    Here is a common example.  B2 and C2 are from the formulas shown in B1 and C1. They should both be exactly zero, if done with paper and pencil.  Neither is exactly zero (though I have them formatted with 2 decimals so they appear to be 0.00), they are different from each other, and subtracting one from the other is also not exactly zero.

  • A fraudulent order placed on my account was cought and cancelled by Verizon, but I'm still being billed for it.

    I am a Verizon customer in North Carolina. For the past few months I have been unsuccessfully trying to correct a problem with my account that seems to be getting so out of hand that now when I call to address it, the Verizon representative can’t understand the issue. So I’ve decided to put the issue down in writing to see if someone here can help me…
    On May 22nd I received a text stating that my address had been changed. Shortly thereafter I received a phone call from the Verizon fraud department trying to verify an order that was placed on my account. When I told them that I had made no such order, It was explained to me that someone had likely obtained my account info and fraudulently ordered equipment in my name to be sent to an address in Ohio. I was told that the order would be cancelled, my address was changed back to my correct North Carolina address, my MyVerizon account was deleted and I would have to create a new one, and that I would not see any impact on my bill as a result of this issue.
    The following bill I received, dated 6/21/14, included $84.66 of normal charges that I had seen on pretty much every bill before that, and $65.71 worth of equipment charges (which included a $24.99 Edge Agreement payment, and $40.72 for Ohio State sales tax) that were a result of the fraudulent order. When I called to complain about it, I was told by a rep in the Billing Department that there was nothing they could do to correct it, and I would have to speak with the Fraud Department. They forwarded my call to a number that no one answered. Eventually a machine picked up and stated that I would have to fill out a form and someone would call me back, and the machine hung up. I then paid the amount I owed of $84.66 on 7/15/14.
    The next bill, dated 7/21/14, showed; a balance forward of $65.71, monthly, usage and tax charges equaling $94.63, a late fee of $0.41, and equipment charges of $24.99 (fraudulent Edge Agreement). When I called this time I spoke with a rep that actually did a very good job of explaining the situation to me that even though the order was cancelled, the Edge Agreement that was signed in my name (fraudulently) had to be cancelled through a different process, and only the fraud department could initiate it.  She stated that the “form” that had to be completed to get the fraud department to call a customer back was only available to employees, and not the public, so she would have to make the request. She also stated that she’d put a note in my file that an issue with my bill was being worked on so that my service would not be shut off. I never received a phone call from the fraud department. I then paid the monthly usage and tax fees of $94.63, and the late fee of $0.41 (even though I didn’t really owe it in my opinion), totaling $95.04 on 8/18/14.
    The next bill dated 8/21/14, showed; a balance forward of $90.70 (which equates to the equipment charges of $65.71 and $24.99 from the previous two months), an Adjustment of -$10.00 (which was a correction made when I questioned the overusage fee from the previous month), $84.60 of monthly usage and tax fees, a $0.84 late fee, and another equipment charge of $24.99 (fraudulent Edge Agreement). Again, this time when I called I was told the billing department could not help me, I was forwarded to the fraud department and the machine hung up on me. I then paid $74.30 to cover the monthly usage and tax fees on 9/11, while taking credit for the -$10.00 adjustment that I essentially overpaid the month before. Due to a math error on my part, at this point I should have owed $0.30 because I owed $74.60 ($84.60-$10.00) and only paid $74.30.
    The next bill dated 9/21/14, showed; a balance forward of $116.83 (which equates to the equipment charges of $65.71, $24.99, $24.99 from the previous three months, the $0.84 late fee from 8/21, and the $0.30 balance that I actually owed), an Adjustment of -$1.14 (due to a “Fed Univ Srv Credit”), $84.60 of monthly usage and tax fees, a $1.25 late fee, and another equipment charge of $24.99 (fraudulent Edge Agreement). This time when I called, I was forwarded to the fraud department, and someone actually answered the phone! After explaining the situation yet again, I was comfortable that the rep understood my situation, and I was told that they would submit an Edge Agreement cancelation form, which would have to be reviewed by their superior, and then the account would move on to someone who did some kind of balance analysis to see how my account was to be credited for charges that were a result of this fraudulent Edge Agreement. They said I would receive a phone call in a few days to verify the changes that were made. I never received a phone call. I then paid $84.60 to cover the monthly usage and tax fee on 10/1. At the time I made the payment, I wasn’t sure what the -$1.14 adjustment was for, so I didn’t account for it in the payment. Though, understanding now that it had nothing to do with my account problems, I basically made an overpayment of $1.14 in the 10/1 payment, and accounting for the $0.30 that I actually owed from the previous bill, at this point, my account should be at -$0.84 ($0.30-$1.14), that is that $0.84 is owed to me from Verizon.
    Which comes to my latest bill, dated 10/21/14. The bill shows;  a balance forward of $141.93 (which equates to the equipment charges of $65.71, $24.99, $24.99 and $24.99 from the previous four months, the $0.84 late fee from 8/21, the $1.25 late fee from 9/21, and the -$0.84 balance that was actually owed to me), $84.61 of monthly usage and tax fees, a $1.36 late fee, and another equipment charge of $24.99 (fraudulent Edge Agreement). When I called this morning, the rep I spoke to didn’t seem to know which way was up, and didn’t see any problem with my account. As I started to explain the whole situation again, we were disconnected, which prompted me to write this letter. Because I’m tired of explaining this to everyone I speak to, every time I call, and the story just keeps getting longer. I will be making a payment today in the amount of $83.77 to cover the $84.61 of monthly usage and tax fees, and accounting for the -$0.84 starting balance that I should have.
    At this point, I’m receiving 2-3 automated phone calls and text messages from Verizon on a daily basis (which could probably be considered harassment) telling me my balance is past due, yet when I do finally get someone on the phone who understands my issue, I’m told that things are being done to resolve this, but obviously they are not.  I need this issue to be corrected ASAP. I’m done trying to explain this issue over the phone. I NEED SOMEONE TO CONTACT ME IN RESPONSE TO THIS LETTER, TO EXPLAIN TO ME HOW THIS ISSUE WILL BE RESOLVED BY VERIZON.  I will continue to make the payments that are valid due to my usage, but I will not pay any fees associated with an order that was not only identified by Verizon to be fraudulent, but was cancelled by Verizon within the hour that it was made.
    Secondary to the issue explained above, I also have an issue in regard to my Hardware Upgrade Eligibility date.  When the fraudulent order was made my upgrade eligibility date was reset to 24 months after the order was made (05/2016). Since the order was cancelled, and the issue above should be resolved shortly, my upgrade eligibility date should be put back to the date it was at before the order (which was sometime in March of 2015, which corresponds to the date that my contract ends). If my upgrade eligibility date is not corrected, and my contract expires, I will not be staying with Verizon.
    As I write this letter, I have received yet another text message informing me of my past due balance. PLEASE contact me at your earliest convenience, or forward this letter to someone who can help me resolve these issues.

    First thing to always do is write a Certified Return Receipt letter or just copy the post you made and send it to Verizon Wireless and dispute it in writing.
    Then walk down to your local court and file a small claims court case against Verizon for all the fraudulent charges. Verizon will call you before that court case and then it may be possible to get this wiped off your account.
    Also file a BBB complaint http://www.bbb.org
    Again Verizon will contact you to offer to settle. Get the settlement in writing not verbal. Or proceed to court.
    Sorry you are going through hell for something you should never have had to go through.
    Good Luck

  • JTextArea artifacts when selecting/deselecting text

    I just bumped up against a font rendering issue with JTextArea. I have no doubt that it's a bug, but does anyone know of a workaround?
    Run the program below and select/deselect text by double-clicking words. The text is painted in a different location when selected and deselected. Try selecting by dragging the mouse or pressing shift and left/right arrow keys -- same problem, but the actual pixel location of the artifacts sometimes differs depending on the selection start and end, and the way the text was selected (keyboard/mouse drag/double click).
    Now try selecting the last word ("dog") by double clicking.import java.awt.Font;
    import java.awt.font.TextAttribute;
    import java.util.HashMap;
    import java.util.Map;
    import javax.swing.*;
    public class TextAreaProblem {
      public static void main(String[] args) throws Exception {
        SwingUtilities.invokeLater(new Runnable() {
          @Override
          public void run() {
            new TextAreaProblem().makeUI();
      public void makeUI() {
        Map<TextAttribute, Object> attributes = new HashMap<TextAttribute, Object>();
        attributes.put(TextAttribute.FAMILY, "Arial");
        attributes.put(TextAttribute.SIZE, 36.0);
        attributes.put(TextAttribute.POSTURE, TextAttribute.POSTURE_OBLIQUE);
        attributes.put(TextAttribute.TRACKING, TextAttribute.TRACKING_LOOSE);
        Font font = Font.getFont(attributes);
        font = font.deriveFont(attributes);
        final JTextArea textArea = new JTextArea("The quick brown fox jumps over the lazy dog.");
        textArea.setFont(font);
        textArea.setLineWrap(true);
        textArea.setWrapStyleWord(true);
        JFrame frame = new JFrame();
        frame.add(new JScrollPane(textArea));
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.setSize(850, 200);
        frame.setLocationRelativeTo(null);
        frame.setVisible(true);
    Microsoft Windows [Version 6.1.7600]
    Copyright (c) 2009 Microsoft Corporation.  All rights reserved.
    C:\Users\Darryl>java -version
    java version "1.6.0_17"
    Java(TM) SE Runtime Environment (build 1.6.0_17-b04)
    Java HotSpot(TM) Client VM (build 14.3-b01, mixed mode, sharing)Any tips for a workaround will be much appreciated.
    Thanks, Darryl

    The fix using System.setProperty worked 100% for all font and attribute combinations I tried -- thanks again.
    2) Does it work to set the property after the GUI is already created and shown? (shall test that myself in a few hours, but would be nice to know earlier :)No. However, you may set this property as a component client property (on the JTextComponent), but before that component is made visible.This didn't work for me. I tried both putClientProperty and getDocument().putProperty, as suggested in the other thread. What did I miss?import java.awt.Font;
    import java.awt.font.TextAttribute;
    import java.util.HashMap;
    import java.util.Map;
    import javax.swing.*;
    public class TextAreaProblem {
      public static void main(String[] args) throws Exception {
        //System.setProperty("i18n", Boolean.TRUE.toString());
        SwingUtilities.invokeLater(new Runnable() {
          @Override
          public void run() {
            new TextAreaProblem().makeUI();
      public void makeUI() {
        Map<TextAttribute, Object> attributes = new HashMap<TextAttribute, Object>();
        attributes.put(TextAttribute.FAMILY, "Arial");
        attributes.put(TextAttribute.SIZE, 36.0);
        attributes.put(TextAttribute.TRACKING, TextAttribute.TRACKING_LOOSE);
        attributes.put(TextAttribute.UNDERLINE, TextAttribute.UNDERLINE_ON);
        attributes.put(TextAttribute.STRIKETHROUGH, TextAttribute.STRIKETHROUGH_ON);
        Font font = Font.getFont(attributes);
        font = font.deriveFont(attributes);
        final JTextArea textArea = new JTextArea("The quick brown fox jumps over the lazy dog.");
        textArea.setFont(font);
        textArea.setLineWrap(true);
        textArea.setWrapStyleWord(true);
        // tried either or both -- didn't help
        textArea.getDocument().putProperty("i18n", Boolean.TRUE.toString());
        textArea.putClientProperty("i18n", Boolean.TRUE.toString());
        JFrame frame = new JFrame();
        frame.add(new JScrollPane(textArea));
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.setSize(850, 200);
        frame.setLocationRelativeTo(null);
        frame.setVisible(true);
    }Darryl
    edit Setting this property seems to remove the ability to render underlined and strikethrough attributes. Changed the code above to add these. When "i18n" is set, they are ignored.
    edit2 GlyphPainter2 also doesn't appear to support foreground/background colors and swap_colors. It's beginning to look like whoever wrote that class solved a single problem of cumulative integer math error but introduced several others. Or maybe just didn't reimplement the features that weren't inherited..
    Edited by: DarrylBurke on Sep 8, 2010 5:13 AM

  • Conditional Appearance of a Form Field

    I'm creating a pdf order form for our products and their replacement parts.  My question is that I want some columns to remain blank if an item isn't being ordered.
    Here's the design:
    Col. 1: Item number/details - Static (this info is typed by me in the design and isn't changeable by the user).
    Col. 2: Item Price - Static.
    Col. 3: Order Quantity - Dynamic (completed by the user/customer). 
    Col. 4: Order Subtotal - Calculated (Col. 2 x Col. 3).  This is the column that I want to be blank if the customer is not ordering any of that particular item.  Right now, if the customer isn't ordering any of that item, they still see a $0.00 in the column and that's what I don't want.
    Is there a way to have a field conditionally appear?  In other words, if Col. 3 is <1, Col. 4 should be completely empty and not even have a $0.00 in it.
    Thanks in advance for any advice.

    I'm using the Calculate function inside the Text Field Properties window. 
    I'm trying to make this form as simple as possible for the customer to use, using as few keystrokes as possible.  I'm also trying to make my form usable for both online ordering using the pdf and manual ordering (print it, fill it in by hand, and fax it to us). I don't want customers to do the math if I can make the software do it easily enough, plus I protect from math errors by having the software do it.
    My issue is I want the Subtotal column (Col. 4 in my example above) to remain empty - completely blank - if they're not ordering that particular item.  However, by making the software do a calculation, it fills in column 4 with "$0.00" even if the quantity is either zero or empty.
    By putting anything in that field for an un-ordered item, it makes the form unusable for manually ordering and difficult to see the forest for the trees for online ordering.  Just trying to clean it up.

  • Can't get Java page to run

    I am probably in the wrong place here, and for that I apologize. We use a program at our school called Power School which is on-line. In order to enter student marks, one accesses a page which is generated by Java. Since I purchased this new computer, I have been unable to access the gradebook. For a while, I was getting an Run Time error, so I installed the Run Time Environment. Then a Big Math error appeared after I finished the installation. So I reinstalled Jave (JRE - 6 u 11) and now I am getting the error about connection shown below. No one at the school can figure it out or get the program running. Can anybody help me, out there?
    Here are the details of the error. It says "Encountered Connection Error, see your adminsitrator" I can get on-line just fine, and my administrator has no idea what the problem is and so cannot fix it. Any advice would be greatly appreciated.
    com.pearson.powerschool.sdk.common.SDKRemoteException:java.net.SocketException: Unknown proxy type : HTTP
    at com.pearson.powerschool.sdk.system.HttpInvokeInvocationHandler.invoke(HttpInvokeInvocationHandler.java:51)
    at $Proxy1.getSchools(Unknown Source)
    at com.pearson.powerschool.gradebook.Main.login(Main.java:358)
    at com.pearson.powerschool.gradebook.Main.startUI(Main.java:91)
    at com.pearson.powerschool.gradebook.Main.access$000(Main.java:36)
    at com.pearson.powerschool.gradebook.Main$1.run(Main.java:124)
    at java.awt.event.InvocationEvent.dispatch(Unknown Source)
    at java.awt.EventQueue.dispatchEvent(Unknown Source)
    at com.pearson.powerschool.gradebook.CustomEventQueue.dispatchEvent(CustomEventQueue.java:19)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.run(Unknown Source)
    Caused By:java.net.SocketException:Unknown proxy type : HTTP
    at java.net.SocksSocketImpl.connect(Unknown Source)
    at java.net.Socket.connect(Unknown Source)
    at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.apache.commons.httpclient.protocol.ReflectionSocketFactory.createSocket(ReflectionSocketFactory.java:139)
    at org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory.createSocket(DefaultProtocolSocketFactory.java:124)
    at org.apache.commons.httpclient.HttpConnection.open(HttpConnection.java:706)
    at org.apache.commons.httpclient.MultiThreadedHttpConnectionManager$HttpConnectionAdapter.open(MultiThreadedHttpConnectionManager.java:1321)
    at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:386)
    at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:170)
    at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:396)
    at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:324)
    at org.meno.remoting.httpinvoke.client.HTTPInvokeProxyFactory.invoke(HTTPInvokeProxyFactory.java:145)
    at org.meno.remoting.httpinvoke.client.HTTPInvokeProxyFactory.access$000(HTTPInvokeProxyFactory.java:23)
    at org.meno.remoting.httpinvoke.client.HTTPInvokeProxyFactory$1.invoke(HTTPInvokeProxyFactory.java:68)
    at $Proxy1.getSchools(Unknown Source)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at com.pearson.powerschool.sdk.system.HttpInvokeInvocationHandler.invoke(HttpInvokeInvocationHandler.java:40)
    at $Proxy1.getSchools(Unknown Source)
    at com.pearson.powerschool.gradebook.Main.login(Main.java:358)
    at com.pearson.powerschool.gradebook.Main.startUI(Main.java:91)
    at com.pearson.powerschool.gradebook.Main.access$000(Main.java:36)
    at com.pearson.powerschool.gradebook.Main$1.run(Main.java:124)
    at java.awt.event.InvocationEvent.dispatch(Unknown Source)
    at java.awt.EventQueue.dispatchEvent(Unknown Source)
    at com.pearson.powerschool.gradebook.CustomEventQueue.dispatchEvent(CustomEventQueue.java:19)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.run(Unknown Source)

    Looks like a configuration problem to me. Perhaps there's some place where you set up the options which tell the program how to connect to the Internet (because it looks like that's what it's trying to do). If so, browse through there until you find some settings involving "proxy" or something like that. Find somebody else who is using the program and see what they have for those settings.
    Or call the support line for the product, if there is such a thing?
    Edit: I see the product comes from [http://www.powerschool.com/]. There's a Contact Us link on that page. Actually two of them.

  • Execute and pass parameter to external program

    hi all,
    i need to wrap a program using java.
    i would like to write a java program able to ask for user input as soon as wrapped command ask for.
    from the user point of view the behaviour should be the same.
    example
    program to be wrapped: mycommand.exe
    mycommand synopsis
    mycommand file1: mycommand ask for a string and writing it in file file1
    i would like to execute mycommand file1
    in a java program getting the orginal behaviour.
    so...
    String command = "mycommand file1";
    Process process = Runtime.getRuntime().exec(command);
    // from now on somebody can help me?
    thank you
    Luca

    lrasco wrote:
    i would like to write a brute force password cracker (for my own use, i forgot a password).
    rar ask user for password, if ok exit 0 otherwise exit 1 (i suppose).
    my program execute rar, which sholud ask for password, pass a password, check for exit code, then exit or continue.That tells us what you're trying to accomplish, not what problems you're having.
    For the record, I'm extremely skeptical of your claim that this is for the legitimate use of recovering your own password. The proper approach would be to contact the admin to reset it.
    Of course, trying to brute force crack a password by executing an interactive program like this will be extremely slow anyway. Assume a 6 letter password over the 62-character space of uppercase, lowercase, and digits. There are 62^6 = 56,800,235,584 possible passwords. On average, you'll have to search through half of them, which is 28,400,117,792. If you can do 100 / sec., then that will take 28400117792 / 100 / (60 x 60 x 24 x 365) = 9 years.
    EDIT: Stupid math operator markup.
    Edited by: jverd on Jan 13, 2010 11:20 AM
    EDIT: fixed math error
    Edited by: jverd on Jan 13, 2010 11:21 AM

  • Cover Flow - can it have a black background?

    I've just bought a 3rd generation Nano (product RED version) and I'm really pleased with it.
    I do have one question though - can Cover Flow on the Nano have a black background? I'm sure I've seen the 3rd gen Nano working with a black Cover Flow background on some website somewhere and I'd like it much more than it being a white backing.
    On another note, I really cannot understand what seems to be a angry bunch of haters who just have nothing good to say about it (the comments about the 3rd gen Nano on You Tube are nothing short of insane). You really have to see it in the flesh, it's better than it looks in pictures and for the price, what more could you want?

    There doesn't appear to be anything in the iPod nano feature/user guide that says that you can change the background color (I'm talking about the downloadable 71 page manual).
    As for the comments against the new nano, I don't completely understand some of the remarks either. I will note, however, that two threads that were started here to complain about the size of the new nano quickly fell silent after I pointed out that the original poster had made math errors and had used incorrect dimensions when trying to show that the new nano wasn't really "nano" anymore. As it turns out they have practically the same front surface area (0.07 square inch difference) which means that if the new nano was less than a millimeter smaller in either width or height it would actually be smaller than the 2nd generation nano. What I mean to say is that it is still very "nano" in size.

  • Regular Expressions - unsetting greedy possible?

    Hi,
    I'm currently working on a parser and got some problems with the regular expressions in ABAP.
    Lets say I want to calculate (22)*(33).
    The RegExp \(.+\) finds everything between brackets - the problem is, that the engine finds everything between the first opening and the last closing bracket (actually it should find the first opening and the first closing bracket).
    Is there a way to tell the engine to work ungreedy?
    Thanks for your help
    Chris

    Hi Prashant,
    unfortunately this won't work either.
    I'd better give some more information on the topic to increase understanding.
    In order to calculate this string mathmatically I created a function working recursively. It calculates the (math)value of a string.
    So lets say we want to calculate (22)*(33), the function is supposed to work this way:
    math ( "(22)*(33)")
    -> math ("2+2") (Calculating and returning value: 4)
    The formula now is "4*(3+3)"
    -> math("3+3") (Calculating and returning value: 6)
    The formula now is "4*6"
    -> math("4*6") (calculating and returning value 24)
    Thus ABAP does not know ungreedy searches in regular expressions, the function would work this way:
    math ( "(22)*(33)")
    ->math( "22)*(33" ) (using the wrong brackets...)
    ... leading to a math error.
    Your solution, Prashant, would work for the first recursive call. Then, the formula would be "(22)*(32)" again.
    Thanks though
    Regards
    Christian

Maybe you are looking for

  • How can different users spool to the same file?

    I am using SQL*plus for 10g db. I am spooling query output to a file. Query should be run and spooled multiple times overwriting previous output. here is the main piece from the query.sql file SPOOL output.txt SELECT.... SPOOL OFF Let's say user Dan

  • I want to buy a song but it's telling me I don't have enough store credit, I have $1.35 the song cost $1.29 how can I fix this?

    I want to buy a song but it's telling me I don't have enough store credit, I have $1.35 the song cost $1.29 how do I fix this?

  • Tracker has stopped working

    I was not sure which forum to post this question.  I have created a form in LiveCycle Designer and distributed the form through Acrobat.com.  Hundreds of users are using the distributed version of the form.  A new computer has been installed, and we

  • Use of "picture" on my vCard

    I find that the tiny image in the top left of my vCard (the one with the account icon) somehow has a randam photo from iPhoto. I don't know how it got there. I would now like to edit this "picture" to use a snapshot portrait from Photo Booth. I've fo

  • Where my songs are and aren't?

    Load mp3's to iTunes in PC laptop. I'm not sure where to put the mp3 when it's downloaded from Amazon, I have a choice to OPEN or SAVE, so I always choose save and mp3 defaults to DOWNLOAD document. Then I choose OPEN WITH iTunes and the song goes to