Help me! with summing :(

I'm new at java programming, and im working on a program that creates random numbers, the range of the random numbers is -1000 to 1000... my problem is i need a way to add up all the Positive numbers, and negative numbers seperately. Heres my program so far:
import java.util.Random;
public class Averages
     public static void main(String[] args)
          Random generator = new Random ();
          int HowManyNums, Num, Flip, Positives, Negatives;
          String Words = "";
          HowManyNums = 0;
          Positives = 0;
          Negatives = 0;
          SumOfPos = 0;
              while (HowManyNums<101)
              Num = generator.nextInt(1001);
              Flip = generator.nextInt(2);
              HowManyNums++;
              if(Flip == 0)
                   System.out.print(Num*-1+" ");
                   Negatives++;
              if(Flip == 1)
                   System.out.print(Num+" ");
                   Positives++;
          System.out.println();
          System.out.println();
          System.out.println();
          System.out.println("           Summary");     
          System.out.println("-----------------------------");
          System.out.println("Positive Numbers     = "+ Positives);
          System.out.println("Sum of Positives     = ");
}I'll accept any help, just remember they arent determined number, so it makes it a bit more complex... i was kinda wondering if there was a class for summing, that i couldnt find. Tell me the way to find the positives, and ill be able to find the sum of the negatives on my own

Im not sure if this is what you're looking for:
import java.util.Random;
import java.util.ArrayList;
public class Averages
     private Random           generator;
     private int           totalNums, num, flip, positives, negatives;
     private ArrayList      posNums, negNums;
     public Averages() {
          generator      =      new Random();
          posNums          =     new ArrayList();
          negNums          =     new ArrayList();
          run();
          showReport();
     public void run() {
          positives = 0;
          negatives = 0;
          while (totalNums<100)
              num      = generator.nextInt(1001);
              flip      = generator.nextInt(2);
              totalNums++;
              if(flip == 0)
                   num*=-1;
                   negNums.add(new Integer(num));
                   negatives++;
              if(flip == 1)
                   posNums.add(new Integer(num));
                   positives++;
     public int getSum(ArrayList lst) {
          int total = 0;
          for(int i=0; i<lst.size(); i++){
               int current     =     ((Integer)lst.get(i)).intValue();
               total          +=     current;
          return total;
     public void showReport() {
          System.out.println();
          System.out.println();
          System.out.println();
          System.out.println("           Summary");     
          System.out.println("-----------------------------");
          System.out.println("Positive Numbers     = "+ positives);
          System.out.println("Sum of Positives     = "+ getSum(posNums));
          System.out.println("Negative Numbers     = "+ negatives);
          System.out.println("Sum of Negatives     = "+ getSum(negNums));
     public static void main(String[] args)
          new Averages();     
}

Similar Messages

  • Can someone PLEASE help me with my Satellite A665-S5170

    Ok.
    I am going to do my best to sum up what is going on right now. 
    So a few months ago, my uncle passed away, and I now have his laptop. Even though he bought it in March 2011, he never used it, so it was practically brand new when I got it. 
    Long story short, everything was fine up until about a week ago. That is when I noticed something was wrong, but didn't know what. 
    Well I ended up just resetting it to factory settings. ()
    At first I thought that after resetting it, everything would be fine, but I've had to do that with my old Dell Laptop. 
    Well, everything is not fine. 
    Now I just keep getting the same message pop up on my screen every so often, telling me I have to "start the backup process" 
    But I did that already, and it keeps popping up. 
    But there is no pop up about a disk failure, or how to fix it. 
    So, I'm really, really hoping that someone can help me with this!! 
    I uploaded a screen shot of the pop up, so you know exactly what I see. 
    Please and thank youu!! 
    =] 
    Katie.
    Attachments:
    wtf.PNG ‏68 KB

    It seems the hard disk is failing. The notice about backing up doesn't mean that the backup process will fix it. The computer has detected the hard disk is failing and needs replacing. It's suggesting you back up your data so that you can replace the hard drive. You could take it to a service center or try replacing the hard disk yourself. Replacing the HDD isn't usually too terribly difficult if you're comfortable. Somewhere on the bottom will be a door that can be removed to give you access to the drive. Sometimes there's a metal caddy on the drive, and sometimes there isn't it. If there isn't, you simply swap in the new drive. If there is, you'll need to remove the caddy and put it on the new drive. You'll want to ensure you have recovery discs though. You can use the Toshiba Recovery Media Creator (sometimes called Toshiba Recovery Disc Creator) to create back ups. Then you replace the hard drive, put the disc in, and start the recovery process.
    - Peter

  • Pls help me with this program - urgent

    Hi,
    I am new to Java. First time to do the program. Stuck here.
    The description of the program:
    Implement a complex number (numbers of the form a+ib, where i2 = -1, i2 is i raised to power 2 ). Recall that a complex number consists of a real part (a) and an imaginary part (b). Provide a reasonable set of constructors; the methods add, subtract, multiply and divide; as well as toString and equals.
    You are to implement a complex number as having two fields, one for the real part another for the imaginary part.
    If z = a + ib and x = c + id are two complex numbers, then their sum z+ x = (a+c) + i(b+d), quotient z/x = (ac+bd)/(c*c+d*d) + i(-ab+bc)/(c*c + d*d). two complex numbers are equal if their real and imaginary parts are equal.
    I really do not have any clues about imaginary parts and how to do it.
    Could you please help me with that.
    Thanks a lot.

    ur dboubt has nothing to do java.. its a mathematical concept..
    as the question says the complexnumbers can be represented in the form of a+ib where i=squre-root of -1 .. and as this is imaginary (ie u cant get a minus number by squring a number) the second part is called imaginay.
    so as a programmer u dont have to give more strain on this but to declare a class having to instance varaiables and inplememts the methods as said.
    and in the toString() method u can return the numbers in the reuired format like
    return ( a + "+i" +b);

  • Regular measures(measures with SUM function) are not working along Distinct count measures

    Hi All,
    I am creating a cube that got to have a distinct count measure and a sum measure. if i have created only sum measure then it is working fine. if i create both measures and process the cube only distinct count measure is populated. the sum measure is showing
    all blank values. i am using 2008 R2, and creating 2 different measure groups for both measures, after i include the distinct count measure the sum measure becoming null. can you please help me with this? i am breaking my head for last 2 days on this.. Thank
    You

    Ramesh, measures are affected by the context of the queries that contain them, for example and in some cases, you can get a different total count of something by two different queries, this is because the context of the first query is different than
    the second one ... keep this in mind.
    Now, I've noticed that you are "creating 2 different measure
    GROUPS for both measures", and i guess that you are trying to view those two measures _which are from different measure
    groups_ at the same time and in the same report.
    considering the info in the first point and as you are create the calculated measures in two different measure
    groups, I'm not sure but i guess that this is the problem, and i suggest you create those two calculated measures
    in the same measure group, then try to view them again and let's see.
    if the previous point didn't solve it, please post the expressions you are using to create the calculated measures, maybe this will help in finding the problem.  

  • Getting top 9, aggregating the rest - challenge with SUM

    Dear,
    I'd like to get the top 9 customers and aggregate the remaining to one number.
    My query is:
    select k.kundenid, k.KDNR, k.FIRMA_1, sum(a.auftrag_total)
    from auftrag a, kunden k
    where a.kunde_id=k.kundenid and
    TO_CHAR(a.DATUM,'YYYY')=TO_CHAR(sysdate,'YYYY')
    group by k.kundenid, k.KDNR, k.FIRMA_1
    order by 4 desc
    I have tried with DENSE_RANK() but it gets complicated to combine this with SUM()
    Can someone help?
    Kind regards..........Lorenz

    I seem to have hit a bug in XE on windows XP. The following query should work but the 10th record only includes the 10th ranked total, not the total of 10 thru 16.
    If I change the with statement to a create table, the query works. Also, if I just use the second half of the union all I get the correct results. The combination of with and union/union all seems to fail.
    create table auftrag(kunde_id number, kdnr varchar2(20), datum date, auftrag_total number);
    insert into auftrag (select 1  kunde_id, 'cust1'  kdnr, sysdate datum, 1200 auftrag_total from dual);
    insert into auftrag (select 1  kunde_id, 'cust1'  kdnr, sysdate datum, 600  auftrag_total from dual);
    insert into auftrag (select 2  kunde_id, 'cust2'  kdnr, sysdate datum, 1600 auftrag_total from dual);
    insert into auftrag (select 2  kunde_id, 'cust2'  kdnr, sysdate datum, 700  auftrag_total from dual);
    insert into auftrag (select 3  kunde_id, 'cust3'  kdnr, sysdate datum, 500  auftrag_total from dual);
    insert into auftrag (select 3  kunde_id, 'cust3'  kdnr, sysdate datum, 1300 auftrag_total from dual);
    insert into auftrag (select 4  kunde_id, 'cust4'  kdnr, sysdate datum, 200  auftrag_total from dual);
    insert into auftrag (select 5  kunde_id, 'cust5'  kdnr, sysdate datum, 1500 auftrag_total from dual);
    insert into auftrag (select 6  kunde_id, 'cust6'  kdnr, sysdate datum, 800  auftrag_total from dual);
    insert into auftrag (select 7  kunde_id, 'cust7'  kdnr, sysdate datum, 1400 auftrag_total from dual);
    insert into auftrag (select 8  kunde_id, 'cust8'  kdnr, sysdate datum, 300  auftrag_total from dual);
    insert into auftrag (select 9  kunde_id, 'cust9'  kdnr, sysdate datum, 2000 auftrag_total from dual);
    insert into auftrag (select 10 kunde_id, 'cust10' kdnr, sysdate datum, 1900 auftrag_total from dual);
    insert into auftrag (select 11 kunde_id, 'cust11' kdnr, sysdate datum, 400  auftrag_total from dual);
    insert into auftrag (select 12 kunde_id, 'cust12' kdnr, sysdate datum, 1800 auftrag_total from dual);
    insert into auftrag (select 13 kunde_id, 'cust13' kdnr, sysdate datum, 900  auftrag_total from dual);
    insert into auftrag (select 14 kunde_id, 'cust14' kdnr, sysdate datum, 1000 auftrag_total from dual);
    insert into auftrag (select 15 kunde_id, 'cust15' kdnr, sysdate datum, 1700 auftrag_total from dual);
    insert into auftrag (select 16 kunde_id, 'cust16' kdnr, sysdate datum, 100  auftrag_total from dual);
    create table kunden(kundenid number, firma_1 varchar2(20));  
    insert into kunden (select 1  kundenid, 'desc1'  firma_1 from dual);
    insert into kunden (select 2  kundenid, 'desc2'  firma_1 from dual);
    insert into kunden (select 3  kundenid, 'desc3'  firma_1 from dual);
    insert into kunden (select 4  kundenid, 'desc4'  firma_1 from dual);
    insert into kunden (select 5  kundenid, 'desc5'  firma_1 from dual);
    insert into kunden (select 6  kundenid, 'desc6'  firma_1 from dual);
    insert into kunden (select 7  kundenid, 'desc7'  firma_1 from dual);
    insert into kunden (select 8  kundenid, 'desc8'  firma_1 from dual);
    insert into kunden (select 9  kundenid, 'desc9'  firma_1 from dual);
    insert into kunden (select 10 kundenid, 'desc10' firma_1 from dual);
    insert into kunden (select 11 kundenid, 'desc11' firma_1 from dual);
    insert into kunden (select 12 kundenid, 'desc12' firma_1 from dual);
    insert into kunden (select 13 kundenid, 'desc13' firma_1 from dual);
    insert into kunden (select 14 kundenid, 'desc14' firma_1 from dual);
    insert into kunden (select 15 kundenid, 'desc15' firma_1 from dual);
    insert into kunden (select 16 kundenid, 'desc16' firma_1 from dual);
    commit;
    with t_rank as (
       select to_char(kunde_id) kunde_id, kdnr, firma_1, sum(auftrag_total) sum_at,
          row_number() over (order by sum(auftrag_total) desc) rn
       from auftrag, kunden
       where kunde_id = kundenid
       and trunc(datum,'y') = trunc(sysdate,'y')
       group by kunde_id, kdnr, firma_1)     
    select *
    from t_rank
    where rn <= 9
    union all
    select 'Rest', 'Rest', 'Rest', sum(sum_at), 10
    from t_rank
    where rn > 9
    order by 5

  • Help Needed with a Formula

    Can someone help me with a particular formula I need?
    I’ve set up a simple sheet to track budget spending for Christmas.
    http://i623.photobucket.com/albums/tt320/_dash/NumbersShot.png
    Let’s say we have $500 to spend. What I want to do is have it so that when a purchase amount is entered into D3, D9 would then show $500 less that amount (thus automatically reflecting how much is left to spend without having to do the math).
    Then later when an amount is entered into D4, D9 would show $500 less the amounts in D3 and D4, etc.
    What formula would I need to put in D9 for this?

    I figured it out.
    In case this will help someone, I put the total available to spend in D2 and then put this formula in D9:
    =D2-SUM(D3:D8)

  • Deployment of JAVA-Patches with SUM failed, MOPZ has downloaded malicious code

    some time ago, we did an upgrade of our doublestack PI-System from NW-PI-700-SPS18 to NW-PI-731-SPS05.
    Now, i wanted to upgrade this PI-system from NW-PI-731-SPS05 to NW-PI-731-SPS07.
    with SUM 1.0 SP10 PL4 we are now failing in the Execution-phase (Downtime):
    Error in phase 5.6. execution (downtime) of the JAVA-Part
    F  ********************************************************************************
    F  *** ERROR => Node 'deployment' failed with exit code 67.
    F  ***
    F  *** Please see section 'Failures in the 'deploying offline components' phase'
    F  *** in SAP Note 1316652 for additional information and trouble shooting advice.
    F  ********************************************************************************
    and the instance could not start up anymore !?
    in sap-note 1316652 there is mentioned a separate sap-note 1550641 for this error
    http://service.sap.com/sap/support/notes/1316652
    in sap-note 1550641 - Update fails-Node 'deployment' failed with exit code 67.           
    http://service.sap.com/sap/support/notes/1550641
    Solution:
    A fix cannot be deployed as a patch, because the deployer itself is broken.
    The solution is to reset a back up state of the system, to download the new version of the stack from SAP Marketplace, and to rerun the update/upgrade procedure.
    i downloaded the patch-stack (with Solman MOPZ) some days ago,
    so MOPZ did download the malicious code of deployment components..... ?!
    so what to do?

    Hi,
    sorry for my late reply,
    but the whole story needs a lot of time (nearly 2 month) and finally ends successfully.
    first: (summary) the main-title of this thread is wrong,
    it was not MOPZ or Solman download, what caused this issue.
    the problem was caused by a remaining (old) sapxmltoolkit.jar in the java-bootstrap folder
    details are coming ...
    (all dates in yyyy-mm-dd)
    =========================================
    2014-05-16 at 13:04 CET: 
    SUM upgrade hangs with java-server did not start (in phase 5.2. Execution = downtime)
    i opend OSS-ticket with several details + logs attached and opened the connection to our system.
    SAP-Ticket, prio_Medium (because it is "only" a sandbox issue),
    2014-05-30 at 20:21 CET:
    1."sign-of-live" from sap-support,
    Asking for additional logfiles from the work-directory of the sap-system
    2014-06-02 at 11:14 CET:
    my Answer to the questions and adding the demanded logfiles.
    2014-06-02 at 21:57 CET:
    2.answer from SAP-support, asking to repeat the last SUM-step, to see, if the issue is still there
    2014-06-03 at 10:22 CET:
    my answer after repeating SUM-step and attaching new logfiles.
    2014-06-03 at 21:18 CET:
    3.answer from SAP-support, i should check if system is up and running, if hostname, port-no is correct.
    2014-06-03 at 10:22 CET:
    my answer: hostname + portnr are o.k. - but system still did not startup (java-server)
    2014-06-04 at 19:30 CET:
    4.answer from SAP-support, delivering an upload-URL, could not read attached splitted .zip-files of log-files
    2014-06-05 at 07:28 CET:
    i did collect all logfiles again and uploaded them to the 1.upload-URL
    2014-06-05 at 16:48 CET:
    5.answer from SAP-support, give hint to sap-note: 1550641 - Update fails-Node 'deployment' failed with exit code 67
    2014-06-06 at 10:17 CET:
    i answered that (in my opinion) the mentioned sap-note did not match the issue (only to NW-7.00) ,
    because i did not have to change anything, only i should do a restore from tape and start SUM from the beginning,
    i insisted in more and deeper investigations by SAP-support.
    2014-06-06 at 19:00 CET:
    6.answer of SAP-support: moving the ticket to the next support-level (developm.support)
    2014-06-09 at 10:11 CET:
    7.answer from SAP-support: asking for new submittion of logfiles of work-dir.
    2014-06-10 at 08:39 CET:
    asking for a new upload-URL because of large logfiles
    2014-06-10 at 17:31 CET:
    8.answer from SAP-support: providing an new upload-URL
    2014-06-10 at 17:53 CET:
    i did collect all logfiles again and uploaded them to the 2.upload-URL
    2014-06-12 at 09:07 CET:
    9.answer from SAP-support: asking for more details, listings of directory-content of ..../j2ee/cluster/...
    2014-06-12 at 10:23 CET:
    i did collect all dir-infos and attached a doc to the ticket
    2014-06-19 at 10:11 CET:
    10.answer from SAP-support: asking for WTS-connection to start investigate and debung on our systems
    2014-06-23 at 10:44 CET:
    i answered, and provided WTS-connection info
    2014-06-26 at 13:12 CET:
    11.answer from SAP-support: could not see a running SID-engine, no SAP-MC, no directory, no folder, where is the engine?
    2014-06-27 at 08:01 CET:
    i answered, and provided detailed server-info and WTS-connection info,
    remembering that SID is in SUM-downtime and java-server is not running, because could not be startet,
    2014-06-30 at 14:01 CET:
    12.answer from SAP-support: asking for an installed java6-sdk(jdk), the java6-jre is not enough to debug.
    2014-07-02 at 11:40 CET:
    my answer after installing java6-sdk on the WTS-server,
    2014-07-07 at 15:11 CET:
    13.answer from SAP-support: after debugging found an very old sapxmltoolkit.jar in the java-bootstrap folder
    moving the ticket to SUM-support - java-developm-support.
    2014-07-09 at 08:36 CET:
    14.answer from SAP-support: (SUM-support - java-developm-support) asking for attaching the SUM stack-xml file to the ticket.
    2014-07-09 at 14:32 CET:
    16.answer from SAP-support: asking to remove the sapxmltoolkit.jar from the java-bootstrap folder and restart SUM (repeat last step)
    2014-07-09 at 15:00 CET:
    i am happy to get the solution to this issue, 
    after removing the .jar file from java-bootstrap folder, SUM restart last step,
    the SUM-phase execution continues to run, java-server could start, ....
    .... finally SUM ended successfully.
    ==================================
    remarks:
    formerly, we did a copy of that mentioned sapxmltoolkit.jar to the java-bootstrap folder (in March 2013) because of investigation PI-processes
    after upgrading from NW-7.00 to NW-7.31, to get PI-system running after upgrade to NW-7.31
    but maybe that formerly issues were caused by other things, cache or so ...
    and since then (March 2013) we could start/stop that PI-system several times without any problem, only SUM-upgrade could not ......
    i really understand that investigating problems in SAP-software (e.g. SUM-process, java-startup ...) is not easy and could have many causes.
    but in summary this SUM-downtime was really large (55 days of downtime) , because of sandbox-system we want to investigate this time,
    to get the solution to this issue.
    if some SAP people want to look for speed-up options in the whole support-process, the OSS_ticket-no is:  ( 459757 / 2014 )
    Thanks to SAP-support (for the helpful solution)
    Christoph

  • Anyone could help me with this report. ?

    Hi to all, anyone could help me with this report ?
    I have this one:
    SELECT 'Factura',T0.ItemCode, T0.Dscription, SUM(Quantity) as Cantidad, Sum(LineTotal)  as Total
    FROM INV1 T0 INNER JOIN OINV T1 ON T0.DocEntry = T1.DocEntry
    INNER JOIN OCRD T2 ON T1.CardCode = T2.CardCode
    INNER JOIN OSLP T3 ON T1.SlpCode = T3.SlpCode
    WHERE ((T1.CardCode >= '[%1]' AND  T1.CardCode <= '[%2]'))
    AND T1.DocDueDate >= '[%4]' AND T1.DocDueDate <= '[%5]'
    AND T3.SlpName >= '[%6]' AND T3.SlpName <= '[%7]'
    GROUP BY T0.ItemCode, T0.Dscription
    UNION
    SELECT 'Abono',T0.ItemCode, T0.Dscription, SUM(Quantity * -1 ) as Cantidad, Sum(LineTotal * - 1) as Total
    FROM RIN1 T0 INNER JOIN ORiN T1 ON T0.DocEntry = T1.DocEntry
    INNER JOIN OCRD T2 ON T1.CardCode = T2.CardCode
    INNER JOIN OSLP T3 ON T1.SlpCode = T3.SlpCode
    WHERE ((T1.CardCode >= '[%1]' AND  T1.CardCode <= '[%2]') )
    AND T1.DocDueDate >= '[%4]' AND T1.DocDueDate <= '[%5]'
    AND T3.SlpName >= '[%6]' AND T3.SlpName <= '[%7]'
    GROUP BY T0.ItemCode, T0.Dscription
    But now I want to introduce this sentence in:
    Select I.ItemCode,I.ItemName,
    (select price from ITM1 where ItemCode=I.ItemCode and PriceList=1),
    (select price from ITM1 where ItemCode=I.ItemCode and PriceList=2),
    (select price from ITM1 where ItemCode=I.ItemCode and PriceList=3),
    (select price from ITM1 where ItemCode=I.ItemCode and PriceList=4)
    From OITM I
    Could you help me ?
    Many thanks.

    Please try this one:
    SELECT 'Factura',T0.ItemCode, T0.Dscription, SUM(Quantity) as Cantidad, Sum(LineTotal) as Total,
    (select price from ITM1 where ItemCode=T0.ItemCode and PriceList=1) 'Price List 1',
    (select price from ITM1 where ItemCode=T0.ItemCode and PriceList=2) 'Price List 2',
    (select price from ITM1 where ItemCode=T0.ItemCode and PriceList=3) 'Price List 3',
    (select price from ITM1 where ItemCode=T0.ItemCode and PriceList=4) 'Price List 4'
    FROM INV1 T0 INNER JOIN OINV T1 ON T0.DocEntry = T1.DocEntry
    INNER JOIN OCRD T2 ON T1.CardCode = T2.CardCode
    INNER JOIN OSLP T3 ON T1.SlpCode = T3.SlpCode
    WHERE ((T1.CardCode >= '[%1]' AND T1.CardCode <= '[%2]'))
    AND T1.DocDueDate >= '[%4]' AND T1.DocDueDate <= '[%5]'
    AND T3.SlpName >= '[%6]' AND T3.SlpName <= '[%7]'
    GROUP BY T0.ItemCode, T0.Dscription
    UNION
    SELECT 'Abono',T0.ItemCode, T0.Dscription, SUM(Quantity * -1 ) as Cantidad, Sum(LineTotal * - 1) as Total,
    (select price from ITM1 where ItemCode=T0.ItemCode and PriceList=1) 'Price List 1',
    (select price from ITM1 where ItemCode=T0.ItemCode and PriceList=2) 'Price List 2',
    (select price from ITM1 where ItemCode=T0.ItemCode and PriceList=3) 'Price List 3',
    (select price from ITM1 where ItemCode=T0.ItemCode and PriceList=4) 'Price List 4'
    FROM RIN1 T0 INNER JOIN ORiN T1 ON T0.DocEntry = T1.DocEntry
    INNER JOIN OCRD T2 ON T1.CardCode = T2.CardCode
    INNER JOIN OSLP T3 ON T1.SlpCode = T3.SlpCode
    WHERE ((T1.CardCode >= '[%1]' AND T1.CardCode <= '[%2]') )
    AND T1.DocDueDate >= '[%4]' AND T1.DocDueDate <= '[%5]'
    AND T3.SlpName >= '[%6]' AND T3.SlpName <= '[%7]'
    GROUP BY T0.ItemCode, T0.Dscription
    Thanks,
    Gordon

  • Could someone help me with a Runtime Error while saving a PDF file?

    While saving a 28 page PDF file in Illustrator today, I got a window saying, "This application has requested the "Runtime" to terminate it in a unusual way." It said to contact the applications support team for more information. I keep getting the same thing each time I try it. Does anyone know how to fix this issue or how I contact the applications support team ?
    Thank you for any insight.
    Pam

    It is a 13.5x11 inch calendar. There are 14 pages with images on them and
    some text. The other pages have text, a grid and a colored background with a
    gaussian blur. I saved each page as an "outline".
    The printer I am using requested I save all pages in a pdf file. I was
    successful in saving all but about six pages, now I can't even open the
    file.
    What happens is... I open Illustrator
                                   I open the pdf file
                                   A window appears that says... Runtime Error,
    This application has requested the Runtime to terminate it in an unusual
    way. Please contact the application's support team for more information.
                                   I select ok
                                   then a window appears that says... Adobe
    Illustrator CS5 has stopped working. A problem caused the program to stop
    working correctly. Windows will close the program and notify you if a
    solution is available.
                                   Then the program closes.
    So far I have not been notified of anything.
    Please let me know if you need more details.
    Thank you so much for helping me with this.
    Pam

  • Can someone pls help me with this code

    The method createScreen() creates the first screen wherein the user makes a selection if he wants all the data ,in a range or single data.The problem comes in when the user makes a selection of single.that then displays the singleScreen() method.Then the user has to input a key data like date or invoice no on the basis of which all the information for that set of data is selected.Now if the user inputs a wrong key that does not exist for the first time the program says invalid entry of data,after u click ok on the option pane it prompts him to enter the data again.But since then whenever the user inputs wrong data the program says wrong data but after displaying the singlescreen again does not wait for input from the user it again flashes the option pane with the invalid entry message.and this goes on doubling everytime the user inputs wrong data.the second wrong entry of data flashes the error message twice,the third wrong entry flashes the option pane message 4 times and so on.What actually happens is it does not wait at the singlescreen() for user to input data ,it straight goes into displaying the JOptionPane message for wrong data entry so we have to click the optiion pane twice,four times and so on.
    Can someone pls help me with this!!!!!!!!!
    import java.util.*;
    import javax.swing.*;
    import javax.swing.event.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.text.*;
    import java.util.*;
    public class MainMenu extends JFrame implements ActionListener,ItemListener{
    //class     
         FileReaderDemo1 fd=new FileReaderDemo1();
         FileReaderDemo1 fr;
         Swing1Win sw;
    //primary
         int monthkey=1,counter=0;
         boolean flag=false,splitflag=false;
         String selection,monthselection,dateselection="01",yearselection="00",s,searchcriteria="By Date",datekey,smonthkey,invoiceno;
    //arrays
         String singlesearcharray[];
         String[] monthlist={"Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sept","Oct","Nov","Dec"};
         String[] datelist=new String[31];
         String[] yearlist=new String[100];
         String[] searchlist={"By Date","By Invoiceno"};
    //collection
         Hashtable allinvoicesdata=new Hashtable();
         Vector data=new Vector();
         Enumeration keydata;
    //components
         JButton next=new JButton("NEXT>>");
         JComboBox month,date,year,search;
         JLabel bydate,byinvno,trial;
         JTextField yeartext,invtext;
         JPanel panel1,panel2,panel3,panel4;
         JRadioButton single,range,all;
         ButtonGroup group;
         JButton select=new JButton("SELECT");
    //frame and layout declarations
         JFrame jf;
         Container con;
         GridBagLayout gridbag=new GridBagLayout();
         GridBagConstraints gc=new GridBagConstraints();
    //constructor
         MainMenu(){
              jf=new JFrame();
              con=getContentPane();
              con.setLayout(null);
              fr=new FileReaderDemo1();
              createScreen();
              setSize(500,250);
              setLocation(250,250);
              setVisible(true);
    //This is thefirst screen displayed
         public void createScreen(){
              group=new ButtonGroup();
              single=new JRadioButton("SINGLE");
              range=new JRadioButton("RANGE");
              all=new JRadioButton("ALL");
              search=new JComboBox(searchlist);
              group.add(single);
              group.add(range);
              group.add(all);
              single.setBounds(100,50,100,20);
              search.setBounds(200,50,100,20);
              range.setBounds(100,90,100,20);
              all.setBounds(100,130,100,20);
              select.setBounds(200,200,100,20);
              con.add(single);
              con.add(search);
              con.add(range);
              con.add(all);
              con.add(select);
              search.setEnabled(false);
              single.addItemListener(this);
              search.addActionListener(new MyActionListener());     
              range.addItemListener(this);
              all.addItemListener(this);
              select.addActionListener(this);
         public class MyActionListener implements ActionListener{
              public void actionPerformed(ActionEvent a){
                   JComboBox cb=(JComboBox)a.getSource();
                   if(a.getSource().equals(month))
                        monthkey=((cb.getSelectedIndex())+1);
                   if(a.getSource().equals(date)){
                        dateselection=(String)cb.getSelectedItem();
                   if(a.getSource().equals(year))
                        yearselection=(String)cb.getSelectedItem();
                   if(a.getSource().equals(search)){
                        searchcriteria=(String)cb.getSelectedItem();
         public void itemStateChanged(ItemEvent ie){
              if(ie.getItem()==single){
                   selection="single";     
                   search.setEnabled(true);
              else if (ie.getItem()==all){
                   selection="all";
                   search.setEnabled(false);
              else if (ie.getItem()==range){
                   search.setEnabled(false);
         public void actionPerformed(ActionEvent ae){          
              if(ae.getSource().equals(select))
                        if(selection.equals("single")){
                             singleScreen();
                        if(selection.equals("all"))
                             sw=new Swing1Win();
              if(ae.getSource().equals(next)){
                   if(monthkey<9)
                        smonthkey="0"+monthkey;
                   System.out.println(smonthkey+"/"+dateselection+"/"+yearselection+"it prints this");
                   allinvoicesdata=fr.read(searchcriteria);
                   if (searchcriteria.equals("By Date")){
                        System.out.println("it goes in this");
                        singleinvoice(smonthkey+"/"+dateselection+"/"+yearselection);
                   else if (searchcriteria.equals("By Invoiceno")){
                        invoiceno=invtext.getText();
                        singleinvoice(invoiceno);
                   if (flag == false){
                        System.out.println("flag is false");
                        singleScreen();
                   else{
                   System.out.println("its in here");
                   singlesearcharray=new String[data.size()];
                   data.copyInto(singlesearcharray);
                   sw=new Swing1Win(singlesearcharray);
         public void singleinvoice(String searchdata){
              keydata=allinvoicesdata.keys();
              while(keydata.hasMoreElements()){
                        s=(String)keydata.nextElement();
                        if(s.equals(searchdata)){
                             System.out.println(s);
                             flag=true;
                             break;
              if (flag==true){
                   System.out.println("vector found");
                   System.exit(0);
                   data= ((Vector)(allinvoicesdata.get(s)));
              else{
                   JOptionPane.showMessageDialog(jf,"Invalid entry of date : choose again");     
         public void singleScreen(){
              System.out.println("its at the start");
              con.removeAll();
              SwingUtilities.updateComponentTreeUI(con);
              con.setLayout(null);
              counter=0;
              panel2=new JPanel(gridbag);
              bydate=new JLabel("By Date : ");
              byinvno=new JLabel("By Invoice No : ");
              dateComboBox();
              invtext=new JTextField(6);
              gc.gridx=0;
              gc.gridy=0;
              gc.gridwidth=1;
              gridbag.setConstraints(month,gc);
              panel2.add(month);
              gc.gridx=1;
              gc.gridy=0;
              gridbag.setConstraints(date,gc);
              panel2.add(date);
              gc.gridx=2;
              gc.gridy=0;
              gc.gridwidth=1;
              gridbag.setConstraints(year,gc);
              panel2.add(year);
              bydate.setBounds(100,30,60,20);
              con.add(bydate);
              panel2.setBounds(170,30,200,30);
              con.add(panel2);
              byinvno.setBounds(100,70,100,20);
              invtext.setBounds(200,70,50,20);
              con.add(byinvno);
              con.add(invtext);
              next.setBounds(300,200,100,20);
              con.add(next);
              if (searchcriteria.equals("By Invoiceno")){
                   month.setEnabled(false);
                   date.setEnabled(false);
                   year.setEnabled(false);
              else if(searchcriteria.equals("By Date")){
                   byinvno.setEnabled(false);
                   invtext.setEnabled(false);
              monthkey=1;
              dateselection="01";
              yearselection="00";
              month.addActionListener(new MyActionListener());
              date.addActionListener(new MyActionListener());
              year.addActionListener(new MyActionListener());
              next.addActionListener(this);
              invtext.addKeyListener(new KeyAdapter(){
                   public void keyTyped(KeyEvent ke){
                        char c=ke.getKeyChar();
                        if ((c == KeyEvent.VK_BACK_SPACE) ||(c == KeyEvent.VK_DELETE)){
                             System.out.println(counter+"before");
                             counter--;               
                             System.out.println(counter+"after");
                        else
                             counter++;
                        if(counter>6){
                             System.out.println(counter);
                             counter--;
                             ke.consume();
                        else                    
                        if(!((Character.isDigit(c) || (c == KeyEvent.VK_BACK_SPACE) || (c == KeyEvent.VK_DELETE)))){
                             getToolkit().beep();
                             counter--;     
                             JOptionPane.showMessageDialog(null,"please enter numerical value");
                             ke.consume();
              System.out.println("its at the end");
         public void dateComboBox(){          
              for (int counter=0,day=01;day<=31;counter++,day++)
                   if(day<=9)
                        datelist[counter]="0"+String.valueOf(day);
                   else
                        datelist[counter]=String.valueOf(day);
              for(int counter=0,yr=00;yr<=99;yr++,counter++)
                   if(yr<=9)
                        yearlist[counter]="0"+String.valueOf(yr);
                   else
                        yearlist[counter]=String.valueOf(yr);
              month=new JComboBox(monthlist);
              date=new JComboBox(datelist);
              year=new JComboBox(yearlist);
         public static void main(String[] args){
              MainMenu mm=new MainMenu();
         public class WindowHandler extends WindowAdapter{
              public void windowClosing(WindowEvent we){
                   jf.dispose();
                   System.exit(0);
    }     

    Hi,
    I had a similar problem with a message dialog. Don't know if it is a bug, I was in a hurry and had no time to search the bug database... I found a solution by using keyPressed() and keyReleased() instead of keyTyped():
       private boolean pressed = false;
       public void keyPressed(KeyEvent e) {
          pressed = true;
       public void keyReleased(KeyEvent e) {
          if (!pressed) {
             e.consume();
             return;
          // Here you can test whatever key you want
       //...I don't know if it will help you, but it worked for me.
    Regards.

  • Can anyone help me with Magicjack? after I purchased US number I am unable to log in on my Iphone, I keep getting an error "YOUR DEVICE IS NOT ON THIS ACCOUNT" I contacted MJ support but they are very much useless and dont know how to fix it!

    can anyone help me with Magicjack? after I purchased US number I am unable to log in on my Iphone, I keep getting an error "YOUR DEVICE IS NOT ON THIS ACCOUNT" I contacted MJ support but they are very much useless and dont know how to fix it!

    There's a whole lot to read in your post, and frankly I have not read it all.
    Having said that, this troubleshooting guide should help:
    http://support.apple.com/kb/TS1538
    In particular, pay attention to the mobile device support sections near the bottom, assuming you have already done the items above it.

  • Hello, we have both Creative Cloud and Creative Cloud for teams. Can you help me with the difference and if i need to have both?

    Hello, we have both Creative Cloud membership and Creative Cloud for team. Can you help me with the difference and if i need to have both? We have 9 employees that are using it. Just not sure if i'm paying for something i don't need.
    Thank you

    Please refer to Creative Cloud Help | Creative Cloud / Common Questions
    CC is for retail use with 20 GB of storage space, CCT is where number of seats are purchased & assigned by one program admin where each seat gets 100GB of storage space.
    You can not have both the CC & team in one account as it will only provide you added storage space of 120 GB but you can activate the CC any of them or either of them twice as CC is based on Adobe ID.
    Regards
    Rajshree

  • HELP me with my K7N2 delta ilsr

    Can anyone help me with this problem. I have just upgraded to MSI's K7N2 delta ilsr motherboard. Its all working quite well apart from the fact that the pc wont start up from cold....at all.
    When I start the pc from an off state, it runs up the fans and drives, but does not post.
    The diagnostic led pannel on the back of the pc shows that the cpu is faulty or not installed correctly.
    If I then press the reset button, the pc posts, and boots up just fine.
    It does this EVERY time I start up.
    I have tried re installing the cpu, which is an XP 2800+ 333 barton, but to no avail.
    I have asked a few questions on other forums, but I cant solve it.
    These are the suggestions so far.
    1. the psu (I have a Tsunami 400 atx psu) could not be giving out enough power on initial startup, but once the pc is running, it has enough to boot the pc from a reset.
    2. The mobo or the bios could be at fault. I have not flashed the bios, or upgraded it in any way from original, so is there an issue with the original bios on these boards, and 2800 barton chips??? Could it be a mobo fault? The pc runs fine once the machine is booted.? how do I test it?
    3. The cpu could be faulty? but would this not stop it running fuull stop?
    4. my ram. I have a single stick of OCZ 512mb pc3200 ddr, which I was told would make the pc fly. Not shure on that statement, but is this ram compatible?? could this be the problem?
    Im fairly new to the upgrade side of things, and I need some help with this one.
    Also, Id be really greatfull if some one could talk me through flashing my bios to the latest version, as the thought of doing this narks me a bit...I dont want to mess it up and get a dead pc...
    HELP

    +3.3v 14A
    +5v 28A
    +12v 16A
    +5vsb 2A
    -5v 0.5A
    -12v 0.8A
    Hope this helps, as my pc seems to be living with its case off a lot these days..haha

  • Pls Help me with steps to add data from xml file to SAP B1 through B1iSN.

    Pls Help me with steps to add data from xml file to SAP B1 through B1iSN. I  am getting stuck in xsl transformation. not able to understand where the mapping code needs to be added.
    Pls explain me the steps for adding data from xml to B1 quotation step by step.
    thanks and regards
    Priya

    Hi,
    Have you checked this: https://sap.na.pgiconnect.com/p45508295/?launcher=false&fcsContent=true&pbMode=normal ?
    Thanks,
    Gordon

  • My MacBook Pro iTunes movie purchase is not showing in iTunes store movie purchases nor does it show on my iPad or Apple TV.  Can someone please help me with a solution?  Thanks.

      First of all, I live in Ho Chi Minh City, Vietnam. Sometimes, I use a VPN to search on the web here. I purchased Toy Story 3 on my MacBook Pro 2011 OS/X - Lion through iTunes.  I initially had trouble downloading it which may be due to being on and off the VPN but after a while it finally downloaded and shows up in my iTunes library on my MacBook. 
      Under my Apple ID account (which is the only Apple ID account I have), I look under purchase history and it shows that I paid for Toy Story which is where I got my Order # from.  But if you go to the iTunes Store then to the Quick Links then click on Purchased, under all my Movies, it does NOT show Toy Story 3 as one of my movies.
      Now when I go to my iPad (3rd gen.), Toy Story 3 does not show up under purchased movies (all or not on my iPad).  It does not show up on my Apple TV as well.  If I want to have Toy Story 3 on my iPad or Apple TV, then it says I have to purchase it again.
      I have searched for help via Apple support communities but so far none of their solutions have worked for me.  I have tried logging off iTunes & App Store on iPad and also shutting down the iPad.  I also made sure that under iTunes Preferences>Store that iTunes in the Clouds purchases is checked. Can someone please help me with this?  Your consideration is greatly appreciated.  Thanks.

    Thanks King_Penguin for taking time to read and reply. 
    I just purchased this movie on Thursday, May 15, so just a few days ago.  I have never had any trouble whatsoever since I have been in Vietnam.  I have downloaded several movies and even music and they have all synced to my respected Apple products except for this purchase. 
    Sorry, I don't quite understand what you mean by studios and different versions.  Could you please explain? 
    I checked my purchased list in my purchase history under my account and there are no hidden items. 

  • HELP NEEDED WITH ADDAPTER-DVI TO VGA.

    PLEASE ...HELP NEEDED WITH WIRING CROSS OVER....CAN YOU HELP WITH BACK OF PLUG CONNECTIONS...I SORTA UNDERSTAND THE PINOUTS BUT CANT MAKE AN EXACT MACH...WOULD LIKE TO BE 100% SURE...
    ......THIS ENSURES NO SMOKE!!!                                                                                           
    THE CARD IS AN ATI RADEON RX9250-DUAL HEAD-.........ADDAPTER IS DVI(ANALOG)MALE TO VGA(ANALOG)FEMALE.
    ANY HELP VERY MUCH APPRECIATED........ SEEMS YOU NEED TO BE ROCKET SCI TO ATTACH A BLOODY PICTURE...SO THIS HAS BEEN BIG WASTE OF FING TIME!

    Quote from: BOBHIGH on 17-December-05, 09:21:31
    Get over it mate !
    I find it easy t read CAPS...and if you dont like it ...DONT READ IT!
    And why bother to reply...some people have nothing better to do.
    Yes there chep and easy to come by...Ive already got a new one.
    All I wanted was to make a diagram of whats inside the bloody thing...it was a simple question and required a simple answer.
    NO NEED TO A WANKA !!
    I feel a bann comming up.
    Have you tryed Google ? really.. your question is inrelevant. No need to reply indeed.
    Why do you come here asking this question anyway ? is it becouse you have a MSI gfx card ? and the adapter has nothing to do with this ?
    You think you can come in here yelling.. thinking we have to put up with it and accept your style of posting. This is not a MSI tech center.. it's a user to user center.. Your question has nothing to do with MSI relavant things anyway's.
    Google = your friend.
    Quote from: BOBHIGH on 17-December-05, 09:21:31
    it was a simple question and required a simple answer
    Simple for who ? you (buying a new one) ? me ? we ?   .really...........
    Quote from: Dynamike on 16-December-05, 04:11:48
    1: There are allot of diffrent types of those adapters.
    If any of the mods have a problem about my reply.. please pm me.

Maybe you are looking for

  • Error while transporting using CTS

    Hello Everyone, While transporting the ESR changes from Dev to integration environment i am getting this error. Its a SOAP to  RFC scenario and first time it worked fine. today when i did some changes and wanted to move again through CTS its giving a

  • Multiple Panics, Lock Ups and Freezes

    My MacBook Pro running 10.8.3 has been having some random shut downs and lock ups lately, the latest of which took the internal boot drive totally offline. I was able to recover it after booting to my external recovery drive and running DiskWarrior 4

  • Table staring changes to dispute cases

    Hi experts, What is the table that stores the changes to dispute cases? I need to build a report on how of fields change, and about how long do they stick in a parcular value. Regards, Mario.

  • Network Newbie: Can't seem to get "Shared Printer" to work

    I've been struggling with this for close to a week now and it's driving me (and my wife) crazy. I have a nice, older iMac (see specs below) that I am trying to (desperately) connect to my wife's shiny new MacBook in order to share a printer. I went t

  • "Run Script" (F5) Flacky Behavior with CREATE PROCEDURE and PACKAGE

    When I have the following create statement in a SQL Worksheet and run the script using "Run Script" (F5), I get the "PROCEDURE bogus Compiled." message. Why does it not tell me that there was a compile error? The procedure is marked with a little red