Need help with NULL values in Crosstables

Hello everybody,
I need some help with NULL values and crosstables. My issue is the following:
I have a query (BW - MDX-Query) that gives me turnover measures for each month. In Crystal Reports I choose crosstable to display this whereby I put all month in columns and all turnover-measures in rows. Each month that has a value (measures are not empty) is chown in the crosstables rows. So far so good. The problem occures when there are month that actually have no values (measures are empty). In that case these months are not chown in columns. But I need CR to display these columns and show the value 0. How can I do that?

Hi Frank,
Cross tab shows the data based on your column and these column fields are grouped and based on the group it will show your summaries. 
If there is no data for any of your group it will not display that group.  In this case you will have to create a standard report which should look like cross tab and to get zero values you need to write formulas .
Example if you want to display Moth wise sales :
if Month() = 01 Then
sum() else 0
Now this formula will check if your month is Jan, then it will sum up the values else it will display zero value. 
This is possible only through standard report not with Cross Tab.
Thanks,
Sastry

Similar Messages

  • Need help on Null value check function

    Hey guys,
    I need to create a function that will accept two values and perform a comparison on them and based on whether or not they're different, return true or false.
    Initially I had no idea about the problems of comparing when a value was null, hence the need for a function, as I need to compare many fields of rows of a table in order to find what has changed.
    Now, I think I have the NULL check logic in place :
    IF R1.X IS NULL THEN
         IF R2.X IS NULL THEN
              RETURN FALSE; -- both R1 and R2 are null so no diffs
         ELSE
              RETURN TRUE; -- R1 is null but R2 is not, so it's a diff
         END IF;
    ELSE
         IF R2.X IS NULL THEN
              RETURN TRUE; -- R1 is not null but R2 is so a diff
         ELSE
              IF R1.X != R2.X THEN
                   RETURN TRUE; -- both not null but different
              ELSE
                   RETURN FALSE; -- both not null but equal
              END IF;
         END IF;
    END IF;My problem is that I don't know how, or if i can, create function that can simply accept two column values without defining their datatypes in the function sig. Reason being that while I will always be comparing like-for-like datatypes, I won't always be comparing the "same" like-for-like datatypes; so as I loop through 100 table rows (differentiated by a date), I'll physically compare all the fields in the rows one by one, and in one instance i'm comapring two NUMBERs and then two VARCHARs and then two DATEs, etc.
    What i didn't want was duplicate func's that are all the same apart from the sig's.
    Is there an easy(ier) way to accomplish this? Is there a more "generic" value type I could use? basically i just want to have a function like :
    CREATE OR REPLACE FUNCTION(val1 VALUE, val2 VALUE)
    And not multiple like :
    CREATE OR REPLACE FUNCTION(val1 NUMBER, val2 NUMBER)
    CREATE OR REPLACE FUNCTION(val1 DATE, val2 DATE)
    and so on.
    Edited by: user11258962 on 28-Jun-2010 09:02

    You can use function overloading. So, although three function will exist, they will all be called the same name, so your code will always call a single function
    create or replace package pkg_compare as
      function is_Alike (p1 in number
                        ,p2 in number) return boolean ; 
      function is_Alike (p1 in varchar2
                        ,p2 in varchar2) return boolean; 
      function is_Alike (p1 in date
                        ,p2 in date) return boolean; 
    end pkg_Compare;
    create or replace package body pkg_compare as
      function is_Alike (p1 in number
                        ,p2 in number) return boolean as
        begin
          return ( nvl(p1,0) = nvl(p2,-1) );
      end is_Alike;
      function is_Alike (p1 in varchar2
                        ,p2 in varchar2) return boolean as
        begin
          return ( nvl(p1,'X') = nvl(p2,'Z') );
      end is_Alike;
      function is_Alike (p1 in date
                        ,p2 in date) return boolean as
        begin
          return ( nvl(p1,sysdate) = nvl(p2,sysdate-1) );
      end is_Alike;
    end pkg_Compare;
    /

  • Need help with trim and null function

    Hi all,
    I need help with a query. I use the trim function to get the first three characters of a string. How do I write my query so if a null value occurs in combination with my trim to say 'Null' in my results?
    Thanks

    Hi,
    Thanks for the reply. What am I doing wrong?
    SELECT trim(SUBSTR(AL1.user_data_text,1,3)),NVL
    (AL1.user_data_text,'XX')
    FROM Table
    I want the XX to appear in the same column as the
    trim.The main thing you're doing wrong is not formatting your code. The solution may become obvious if you do.
    What you're saying is:
    SELECT  trim ( SUBSTR (AL1.user_data_text, 1, 3))
    ,       NVL ( AL1.user_data_text, 'XX' )
    FROM    Tablewhich makes it clear that you're SELECTing two columns, when you only want to have one.
    If you want that column to be exactly like the first column you're currently SELECTing, except that when that column is NULL you want it to be 'XX', then you have to apply NVL to that column, like this:
    SELECT  NVL ( trim ( SUBSTR (AL1.user_data_text, 1, 3))
                , 'XX'
    FROM    Table

  • HELP NEEDED !! Null values in Database

    Hi there !!
    I need help with EJB 3.0 passing null values to database. The situation looks like that :
    I have created EJB entity class called "Osoba.java", it is in relation
    with "Rola.java" (one to many). Each Object of class Osoba can have
    many Roles. Then I created "OsobaServiceBean.java " I included it with
    metod "CreateUnregisteredOsoba(Osoba , Boolean)". From "flex" level I
    call this bean - call is accepted, and as a result new object of class Osoba is added to database. Problem is that only one column is filled in table,
    dispite that in service bean I enforce it to fill all columns (see
    source code - file OsobaServiceBean.java , method
    createUnregisteredOsoba() )
    I provided source code here :
    FILE Rola.java
    package test.granite.ejb3.entity ;
    import javax.persistence.Basic;
    import javax.persistence.CascadeType;
    import javax.persistence.Entity;
    import javax.persistence.ManyToOne;
    @Entity
    public class Rola extends AbstractEntity {
    private static final long serialVersionUID = 1L;
    @Basic
    private String login = new String("");
    @Basic
    private String rola = new String("");
    @Basic
    private String roleGroup = new String("");
    @Basic
    private Boolean zatwierdzony = new Boolean(false);
    @ManyToOne(optional=false)
    private Osoba osoba;
    public Boolean getZatwierdzony() {
    return zatwierdzony;
    public void setZatwierdzony(Boolean zatwierdzony) {
    this.zatwierdzony = zatwierdzony;
    public String getLogin() {
    return login;
    public void setLogin(String login) {
    this.login = login;
    public String getRola() {
    return rola;
    public void setRola(String rola) {
    this.rola = rola;
    public Osoba getOsoba() {
    return osoba;
    public void setOsoba(Osoba osoba) {
    this.osoba = osoba;
    public String getRoleGroup() {
    return roleGroup;
    public void setRoleGroup(String roleGroup) {
    this.roleGroup = roleGroup;
    FILE Osoba.java
    package test.granite.ejb3.entity ;
    import java.util.HashSet;
    import java.util.Set;
    import javax.persistence.Basic;
    import javax.persistence.CascadeType;
    import javax.persistence.Entity;
    import javax.persistence.FetchType;
    import javax.persistence.OneToMany;
    @Entity
    public class Osoba extends AbstractEntity {
    private static final long serialVersionUID = 1L;
    @Basic
    private String imie;
    @Basic
    private String nazwisko;
    @Basic
    private String login;
    @Basic
    private String haslo;
    @OneToMany(cascade=CascadeType.ALL, fetch=FetchType.EAGER,
    mappedBy="osoba")
    private Set<Rola> role = new HashSet<Rola>();
    @Basic
    private String email;
    @Basic
    private String nrTelefonu;
    @Basic
    private int rokStudiow;
    public String getPelneImie() {
    StringBuilder sb = new StringBuilder();
    if (imie != null && imie.length() > 0)
    sb.append(imie);
    if (nazwisko != null && nazwisko.length() > 0) {
    if (sb.length() > 0)
    sb.append(' ');
    sb.append(nazwisko);
    return sb.toString();
    public String getImie() {
    return imie;
    public void setImie(String imie) {
    this.imie = imie;
    public String getNazwisko() {
    return nazwisko;
    public void setNazwisko(String nazwisko) {
    this.nazwisko = nazwisko;
    public String getLogin() {
    return login;
    public void setLogin(String login) {
    this.login = login;
    public String getHaslo() {
    return haslo;
    public void setHaslo(String haslo) {
    this.haslo = haslo;
    public Set<Rola> getRole() {
    return role;
    public void setRole(Set<Rola> role) {
    this.role = role;
    public String getEmail() {
    return email;
    public void setEmail(String email) {
    this.email = email;
    public String getNrTelefonu() {
    return nrTelefonu;
    public void setNrTelefonu(String nrTelefonu) {
    this.nrTelefonu = nrTelefonu;
    public int getRokStudiow() {
    return rokStudiow;
    public void setRokStudiow(int rokStudiow) {
    this.rokStudiow = rokStudiow;
    FILE OsobaServiceBean.java
    package test.granite.ejb3.service;
    import java.util.HashSet;
    import java.util.List;
    import java.util.Set;
    import javax.annotation.security.RolesAllowed;
    import javax.ejb.Local;
    import javax.ejb.Stateless;
    import javax.persistence.Query;
    import org.jboss.annotation.security.SecurityDomain ;
    import test.granite.ejb3.entity.Osoba;
    import test.granite.ejb3.entity.Rola;
    @Stateless
    @Local(OsobaService.class)
    @SecurityDomain("other")
    public class OsobaServiceBean extends AbstractEntityService implements
    OsobaService{
    private static final long serialVersionUID = 1L;
    public OsobaServiceBean() {
    super();
    public List<Osoba> findAllOsoba() {
    return findAll(Osoba.class);
    @SuppressWarnings("unchecked")
    public List<Osoba> findAllOsoba(String name) {
    Query query = manager.createQuery (
    "select distinct p from Osoba p " +
    "where upper(p.imie) like upper('%" + name + "%')
    or upper(p.nazwisko) like upper('%" + name + "%')"
    return query.getResultList();
    public Osoba createOsoba(Osoba person) { // pozwalamy
    tworzyc zeby niezalogowany
    return manager.merge (person); //
    uzytkownik utworzyl osobe
    } // ale
    osoba ta i tak nie bedzie jeszcze
    // zatwierdzona
    @RolesAllowed({"unregistered"})
    public Osoba createUnregisteredOsoba(Osoba person, boolean
    zatwierdzony) {
    Rola niezarejestrowany = new Rola();
    niezarejestrowany.setRola("user");
    niezarejestrowany.setOsoba(person);
    niezarejestrowany.setRoleGroup("Roles");
    niezarejestrowany.setLogin(person.getLogin());
    niezarejestrowany.setZatwierdzony(zatwierdzony);
    Set<Rola> role = new HashSet<Rola>();
    role.add(niezarejestrowany);
    // Arrays;
    Object a[] = role.toArray();
    Rola temp;
    temp = (Rola)a[0];
    System.out.println("Login = " + temp.getLogin() + //
    added only for check !!
    "Rola = " + temp.getLogin() +
    "Zatwierdzony = " +
    temp.getZatwierdzony() +
    "Rolegroup = " + temp.getRoleGroup());
    person.setRole (role);
    return manager.merge(person); //
    uzytkownik utworzyl osobe
    } // ale
    osoba ta i tak nie bedzie jeszcze
    public Osoba modifyOsoba(Osoba person) {
    return manager.merge(person);
    @RolesAllowed({"admin"})
    public void deleteOsoba(Osoba person) {
    person = manager.find(Osoba.class, person.getId());
    manager.remove(person);
    public void deleteRola(Rola rola) {
    rola = manager.find(Rola.class, rola.getId());
    rola.getOsoba().getRole().remove(rola);
    manager.remove(rola);
    DATABASE LISTING :
    -----------------------------------------------------------------+----------\
    --------------------------------------------------------+
    | id | ENTITY_UID | version | rola |
    zatwierdzony | osoba_id | login | RoleGroup |
    -----------------------------------------------------------------+----------\
    --------------------------------------------------------+
    | 1 | | NULL | unregistered |
    | 0 | unregistered | Roles | NULL |
    | 33 | eee91bd9-8c5f-4154-8260-3cac9a18eb97 | 0 | user |
    | 34 | NULL | NULL |
    | 32 | a7ed4e8d-a1ba-473a-921c-73c8f8f89efb | 0 | user |
    | 33 | NULL | NULL |
    -----------------------------------------------------------------+----------\
    --------------------------------------------------------+
    The row numer 1 is added by hand and it works. row number 33 and 32
    are added to database by method CreateUnregisteredOsoba. As you can
    see fields login as well as Roles and RoleGroup are empty (NULL). What
    Im doing wrong ?
    Thanks for your help -
    Roman Kli&#347;
    PS. Table Osoba works fine - everything is added as I want.

    I solved problem.
    The reason why EJB had not added anything to database NULL was becouse wrong names of class. Ive refactored whole class Rola.java to RolaClass.java and suddenly it worked.
    True reason is still unknown but most importent is that it works.
    Thanx for reading topic - hope next time someone will answer my questions.
    By !!

  • Need help with the session state value items.

    I need help with the session state value items.
    Trigger is created (on After delete, insert action) on table A.
    When insert in table B at least one row, then trigger update value to 'Y'
    in table A.
    When delete all rows from a table B,, then trigger update value to 'N'
    in table A.
    In detail report changes are visible, but the trigger replacement value is not set in session value.
    How can I implement this?

    You'll have to create a process which runs after your database update process that does a query and loads the result into your page item.
    For example
    SELECT YN_COLUMN
    FROM My_TABLE
    INTO My_Page_Item
    WHERE Key_value = My_Page_Item_Holding_Key_ValueThe DML process will only return key values after updating, such as an ID primary key updated by a sequence in a trigger.
    If the value is showing in a report, make sure the report refreshes on reload of the page.
    Edited by: Bob37 on Dec 6, 2011 10:36 AM

  • Need help with clickbios ii terminolgy and values. Z77A-GD65 / 3770k

    Hello All 
    I recently purchased a Z77A-GD65 board and after searching I've found the differences in terminology between this and my previous Asus board but still have a couple of settings I cant find any info on.
    System Specs:
    motherboard: msi z77a-gd65
    cpu: intel 3770k
    ram: corsair vengeance 2133mhz 1.5v
    psu: corsair 850w
    First things first is I believe I am running in turbo oc mode. I've selected the oc genie tab on the center right of the bios screen and proceeded to change settings there. With cpu voltage on auto and vdroop set to 50% at 4.6ghz. (I'll try and get screenshots of bios settings soon)
    The following are the terms I need help with:
    In the my oc genie section;
     1. Long duration power limit
     2. Long duration maintained
     3. Short duration power limit
    In the main overclocking section;
     4. Digital Compensation level (not in owners manual, options auto/high)
     5. Cpu core ocp expander (enabled for overclock 4.5ghz+?)
    In the CPU Features section;
     6. long duration power limit w (does "w" stand for watts?)
     7. long duration maintained s   (does "s" stand for seconds?)
     8. short duration power limit
     9. primary plane current limit a  (does "a" stand for amps?)
    10. secondary plane current limit
    11. primary plane turbo power limit
    12. secondary plane turbo power
    I know those are a lot of settings, but would appreciate any simple definitions as to what they do and recommended values for mild overclocking (4.5-4.80)
    Also on my previous board (Asus P8P67 Pro) my 3770k was stable in prime95 for 18 hrs at 4.5ghz fixed 1.155v with only ram timings put in manually and LLC set to extreme.(or whatever max is called in asus bios) Voltage was fixed and everything else was defailts.

    Well I'm back.  Been digging around for a few days and found some answers to my questions.
    First things first s that for some reason I could not adjust voltage values with the + or - symbols. Clearing cmos did not help this. I had to reflash the bios to get this functionality back as well as clearing cmos before and after the flash.
    So I figured out the values in the oc genie section are the same as the normal section but only used when your using the oc genie. (numbers 1-3)
    Digital compensation level and ocp expander should be set to high and enabled respectively when going for higher overclocks. (4 and 5)
    Now for the rest of my questions ( 6 through 12) I have found suggested settings and some info after hours and hours of searching but still have a couple of questions about them.
    Long/short duration power limit, and primary/secondary plane turbo limit. I see suggestion settings of 250 or 255. I take it this is simply max supplied watts to the chip? If so why the 250/255 values? Is that the highest the board will give? Is plane turbo limit related to the enhanced turbo stated and how much wattage can be drawn there while the other limit is for any non turbo frequencies?
    Long duration maintained, I've seen 60 suggested a lot. Why is this?
    There's not an over abundance of info on these boards as compared to asus so it seems info is a little less documented and video tutorials explaining things are next to none.
    Any help would be appreciated. Thanks 

  • Need Help With File Matching Records

    I need help with my file matching program.
    Here is how it suppose to work: FileMatch class should contain methods to read oldmast.txt and trans.txt. When a match occurs (i.e., records with the same account number appear in both the master file and the transaction file), add the dollar amount in the transaction record to the current balance in the master record, and write the "newmast.txt" record. (Assume that purchases are indicated by positive amounts in the transaction file and payments by negative amounts.)
    When there is a master record for a particular account, but no corresponding transaction record, merely write the master record to "newmast.txt". When there is a transaction record, but no corresponding master record, print to a log file the message "Unmatched transaction record for account number ..." (fill in the account number from the transaction record). The log file should be a text file named "log.txt".
    Here is my following program code:
    // Exercise 14.8: CreateTextFile.java
    // creates a text file
    import java.io.FileNotFoundException;
    import java.lang.SecurityException;
    import java.util.Formatter;
    import java.util.FormatterClosedException;
    import java.util.NoSuchElementException;
    import java.util.Scanner;
    import org.egan.AccountRecord;
    import org.egan.TransactionRecord;
    public class CreateTextFile
      private Formatter output1;  // object used to output text to file
      private Formatter output2;  // object used to output text to file
      // enable user to open file
      public void openTransFile()
        try
          output1 = new Formatter("trans.txt");
        catch (SecurityException securityException)
          System.err.println("You do not have write access to this file.");
          System.exit(1);
        } // end catch
        catch (FileNotFoundException filesNotFoundException)
          System.err.println("Error creating file.");
          System.exit(1);
      } // end method openTransFile
      // enable user to open file
      public void openOldMastFile()
        try
          output2 = new Formatter("oldmast.txt");
        catch (SecurityException securityException)
          System.err.println("You do not have write access to this file.");
          System.exit(1);
        } // end catch
        catch (FileNotFoundException filesNotFoundException)
          System.err.println("Error creating file.");
          System.exit(1);
      } // end method openOldMastFile
      // add transaction records to file
      public void addTransactionRecords()
        // object to be written to file
        TransactionRecord record1 = new TransactionRecord();
        Scanner input1 = new Scanner(System.in);
        System.out.printf("%s\n%s\n%s\n%s\n\n",
          "To terminate input, type the end-of-file indicator",   
          "when you are prompted to enter input.",
          "On UNIX/Linux/Mac OS X type <ctrl> d then press Enter",
          "On Windows type <ctrl> z then press Enter");
        System.out.printf("%s\n%s",
           "Enter account number (> 0) and amount.","? ");
        while (input1.hasNext())  // loop until end-of-file indicator
          try // output values to file
            // retrieve data to be output
            record1.setAccount(input1.nextInt());    // read account number
            record1.setAmount(input1.nextDouble());  // read amount
            if (record1.getAccount() > 0)
              // write new record
              output1.format("%d %.2f\n", record1.getAccount(), record1.getAmount());
            } // end if
            else
              System.out.println("Account number must be greater than 0.");
            } // end else
          } // end try
          catch (FormatterClosedException formatterClosedException)
            System.err.println("Error writing to file.");
            return;
          } // end catch
          catch (NoSuchElementException elementException)
            System.err.println("Invalid input. Please try again.");
            input1.nextLine(); // discard input so user can try again
          } // end catch
          System.out.printf("%s %s\n%s", "Enter account number (> 0) ",
            "and amount.","? ");
        } // end while
      } // end method addTransactionRecords
      // add account records to file
      public void addAccountRecords()
        // object to be written to file
        AccountRecord record2 = new AccountRecord();
        Scanner input2 = new Scanner(System.in);
        System.out.printf("%s\n%s\n%s\n%s\n\n",
          "To terminate input, type the end-of-file indicator",   
          "when you are prompted to enter input.",
          "On UNIX/Linux/Mac OS X type <ctrl> d then press Enter",
          "On Windows type <ctrl> z then press Enter");
        System.out.printf("%s\n%s",
           "Enter account number (> 0), first name, last name and balance.","? ");
        while (input2.hasNext())  // loop until end-of-file indicator
          try // output values to file
            // retrieve data to be output
            record2.setAccount(input2.nextInt());    // read account number
            record2.setFirstName(input2.next());      // read first name
            record2.setLastName(input2.next());       // read last name
            record2.setBalance(input2.nextDouble());  // read balance
            if (record2.getAccount() > 0)
              // write new record
              output2.format("%d %s %s %.2f\n", record2.getAccount(), record2.getFirstName(),
                record2.getLastName(), record2.getBalance());
            } // end if
            else
              System.out.println("Account number must be greater than 0.");
            } // end else
          } // end try
          catch (FormatterClosedException formatterClosedException)
            System.err.println("Error writing to file.");
            return;
          } // end catch
          catch (NoSuchElementException elementException)
            System.err.println("Invalid input. Please try again.");
            input2.nextLine(); // discard input so user can try again
          } // end catch
          System.out.printf("%s %s\n%s", "Enter account number (> 0),",
            "first name, last name and balance.","? ");
        } // end while
      } // end method addAccountRecords
      // close file
      public void closeTransFile()
        if (output1 != null)
          output1.close();
      } // end method closeTransFile
      // close file
      public void closeOldMastFile()
        if (output2 != null)
          output2.close();
      } // end method closeOldMastFile
    } // end class CreateTextFile--------------------------------------------------------------------------------------------------
    // Exercise 14.8: CreateTextFileTest.java
    // Testing class CreateTextFile
    public class CreateTextFileTest
       // main method begins program execution
       public static void main( String args[] )
         CreateTextFile application = new CreateTextFile();
         application.openTransFile();
         application.addTransactionRecords();
         application.closeTransFile();
         application.openOldMastFile();
         application.addAccountRecords();
         application.closeOldMastFile();
       } // end main
    } // end class CreateTextFileTest-------------------------------------------------------------------------------------------------
    // Exercise 14.8: TransactionRecord.java
    // A class that represents on record of information
    package org.egan; // packaged for reuse
    public class TransactionRecord
      private int account;
      private double amount;
      // no-argument constructor calls other constructor with default values
      public TransactionRecord()
        this(0,0.0); // call two-argument constructor
      } // end no-argument AccountRecord constructor
      // initialize a record
      public TransactionRecord(int acct, double amt)
        setAccount(acct);
        setAmount(amt);
      } // end two-argument TransactionRecord constructor
      // set account number
      public void setAccount(int acct)
        account = acct;
      } // end method setAccount
      // get account number
      public int getAccount()
        return account;
      } // end method getAccount
      // set amount
      public void setAmount(double amt)
        amount = amt;
      } // end method setAmount
      // get amount
      public double getAmount()
        return amount;
      } // end method getAmount
    } // end class TransactionRecord -------------------------------------------------------------------------------------------------
    // Exercise 14.8: AccountRecord.java
    // A class that represents on record of information
    package org.egan; // packaged for reuse
    import org.egan.TransactionRecord;
    public class AccountRecord
      private int account;
      private String firstName;
      private String lastName;
      private double balance;
      // no-argument constructor calls other constructor with default values
      public AccountRecord()
        this(0,"","",0.0); // call four-argument constructor
      } // end no-argument AccountRecord constructor
      // initialize a record
      public AccountRecord(int acct, String first, String last, double bal)
        setAccount(acct);
        setFirstName(first);
        setLastName(last);
        setBalance(bal);
      } // end four-argument AccountRecord constructor
      // set account number
      public void setAccount(int acct)
        account = acct;
      } // end method setAccount
      // get account number
      public int getAccount()
        return account;
      } // end method getAccount
      // set first name
      public void setFirstName(String first)
        firstName = first;
      } // end method setFirstName
      // get first name
      public String getFirstName()
        return firstName;
      } // end method getFirstName
      // set last name
      public void setLastName(String last)
        lastName = last;
      } // end method setLastName
      // get last name
      public String getLastName()
        return lastName;
      } // end method getLastName
      // set balance
      public void setBalance(double bal)
        balance = bal;
      } // end method setBalance
      // get balance
      public double getBalance()
        return balance;
      } // end method getBalance
      // combine balance and amount
      public void combine(TransactionRecord record)
        balance = (getBalance() + record.getAmount()); 
      } // end method combine
    } // end class AccountRecord -------------------------------------------------------------------------------------------------
    // Exercise 14.8: FileMatch.java
    import java.io.File;
    import java.io.FileNotFoundException;
    import java.lang.IllegalStateException;
    import java.util.NoSuchElementException;
    import java.util.Scanner;
    import java.util.Formatter;
    import java.util.FormatterClosedException;
    import org.egan.AccountRecord;
    import org.egan.TransactionRecord;
    public class FileMatch
      private Scanner inTransaction;
      private Scanner inOldMaster;
      private Formatter outNewMaster;
      private Formatter theLog;
      // enable user to open file
      public void openTransFile()
        try
          inTransaction = new Scanner(new File("trans.txt"));
        } // end try
        catch (FileNotFoundException fileNotFoundException)
          System.err.println("Error opening file.");
          System.exit(1);
        } // end catch
      } // end method openTransFile
      // enable user to open file
      public void openOldMastFile()
        try
          inOldMaster = new Scanner(new File("oldmast.txt"));
        } // end try
        catch (FileNotFoundException fileNotFoundException)
          System.err.println("Error opening file.");
          System.exit(1);
        } // end catch
      } // end method openOldMastFile
      // enable user to open file
      public void openNewMastFile()
        try
          outNewMaster = new Formatter("newmast.txt");
        catch (SecurityException securityException)
          System.err.println("You do not have write access to this file.");
          System.exit(1);
        } // end catch
        catch (FileNotFoundException filesNotFoundException)
          System.err.println("Error creating file.");
          System.exit(1);
      } // end method openNewMastFile
      // enable user to open file
      public void openLogFile()
        try
          theLog = new Formatter("log.txt");
        catch (SecurityException securityException)
          System.err.println("You do not have write access to this file.");
          System.exit(1);
        } // end catch
        catch (FileNotFoundException filesNotFoundException)
          System.err.println("Error creating file.");
          System.exit(1);
      } // end method openLogFile
      // update records
      public void updateRecords()
        TransactionRecord transaction = new TransactionRecord();
        AccountRecord account = new AccountRecord();
        try // read records from file using Scanner object
          System.out.println("Start file matching.");
          while (inTransaction.hasNext() && inOldMaster.hasNext())
            transaction.setAccount(inTransaction.nextInt());     // read account number
            transaction.setAmount(inTransaction.nextDouble());   // read amount
            account.setAccount(inOldMaster.nextInt());     // read account number
            account.setFirstName(inOldMaster.next());      // read first name 
            account.setLastName(inOldMaster.next());       // read last name
            account.setBalance(inOldMaster.nextDouble());  // read balance
            if (transaction.getAccount() == account.getAccount())
              while (inTransaction.hasNext() && transaction.getAccount() == account.getAccount())
                account.combine(transaction);
                outNewMaster.format("%d %s %s %.2f\n",
                account.getAccount(), account.getFirstName(), account.getLastName(),
                account.getBalance());
                transaction.setAccount(inTransaction.nextInt());     // read account number
                transaction.setAmount(inTransaction.nextDouble());   // read amount
            else if (transaction.getAccount() != account.getAccount())
              outNewMaster.format("%d %s %s %.2f\n",
              account.getAccount(), account.getFirstName(), account.getLastName(),
              account.getBalance());         
              theLog.format("%s%d","Unmatched transaction record for account number ",transaction.getAccount());
          } // end while
          System.out.println("Finish file matching.");
        } // end try
        catch (NoSuchElementException elementException)
          System.err.println("File improperly formed.");
          inTransaction.close();
          inOldMaster.close();
          System.exit(1);
        } // end catch
        catch (IllegalStateException stateException)
          System.err.println("Error reading from file.");
          System.exit(1);
        } // end catch   
      } // end method updateRecords
      // close file and terminate application
      public void closeTransFile()
        if (inTransaction != null)
          inTransaction.close();
      } // end method closeTransFile
      // close file and terminate application
      public void closeOldMastFile()
        if (inOldMaster != null)
          inOldMaster.close();
      } // end method closeOldMastFile
      // close file
      public void closeNewMastFile()
        if (outNewMaster != null)
          outNewMaster.close();
      } // end method closeNewMastFile
      // close file
      public void closeLogFile()
        if (theLog != null)
          theLog.close();
      } // end method closeLogFile
    } // end class FileMatch-------------------------------------------------------------------------------------------------
    // Exercise 14.8: FileMatchTest.java
    // Testing class FileMatch
    public class FileMatchTest
       // main method begins program execution
       public static void main( String args[] )
         FileMatch application = new FileMatch();
         application.openTransFile();
         application.openOldMastFile();
         application.openNewMastFile();
         application.openLogFile();
         application.updateRecords();
         application.closeLogFile();
         application.closeNewMastFile();
         application.closeOldMastFile();
         application.closeTransFile();
       } // end main
    } // end class FileMatchTest-------------------------------------------------------------------------------------------------
    Sample data for master file:
    Master file                         
    Account Number            Name                     Balance
    100                            Alan Jones                   348.17
    300                            Mary Smith                    27.19
    500                            Sam Sharp                   0.00
    700                            Suzy Green                   -14.22Sample data for transaction file:
    Transaction file                    Transaction
    Account Number                  Amount
    100                                         27.14
    300                                         62.11
    300                                         83.89
    400                                         100.56
    700                                         80.78
    700                                         1.53
    900                                         82.17  -------------------------------------------------------------------------------------------------
    My FileMatch class program above has bugs in it.
    The correct results for the newmast.txt:
    100  Alan  Jones  375.31
    300  Mary  Smith  173.19
    500  Sam  Sharp  0.00
    700  Suzy Green  68.09The correct results for the log.txt:
    Unmatched transaction record for account number 400Unmatched transaction record for account number 900------------------------------------------------------------------------------------------------
    My results for the newmast.txt:
    100 Alan Jones 375.31
    300 Mary Smith 111.08
    500 Sam Sharp 0.00
    700 Suzy Green -12.69My results for the log.txt
    Unmatched transaction record for account number 700-------------------------------------------------------------------------------------------------
    I am not sure what is wrong with my code above to make my results different from the correct results.
    Much help is appreciated. Please help.

    From the output, it looks like one problem is just formatting -- apparently you're including a newline in log entries and not using tabs for the newmast output file.
    As to why the numbers are off -- just from glancing over it, it appears that the problem is when you add multiple transaction values. Since account.combine() is so simple, I suspect that you're either adding creating transaction objects incorrectly or not creating them when you should be.
    Create test input data that isolates a single case of this (e.g., just the Mary Smith case), and then running your program in a debugger or adding debugging code to the add/combine method, so you can see what's happening in detail.
    Also I'd recommend reconsidering your design. It's a red flag if a class has a name with "Create" in it. Classes represent bundles of independant state and transformations on that state, not things to do.

  • I need help with my EtreCheck report

    Hi All -
    Thanks for taking the time -
    I NEED HELP WITH MY EtreCheck report
    Problem description:
    running slow
    EtreCheck version: 2.1.8 (121)
    Report generated February 19, 2015 at 3:18:49 PM EST
    Download EtreCheck from http://etresoft.com/etrecheck
    Click the [Click for support] links for help with non-Apple products.
    Click the [Click for details] links for more information about that line.
    Hardware Information: ℹ️
        MacBook Pro (15-inch, Mid 2012) (Technical Specifications)
        MacBook Pro - model: MacBookPro9,1
        1 2.6 GHz Intel Core i7 CPU: 4-core
        8 GB RAM Upgradeable
            BANK 0/DIMM0
                4 GB DDR3 1600 MHz ok
            BANK 1/DIMM0
                4 GB DDR3 1600 MHz ok
        Bluetooth: Good - Handoff/Airdrop2 supported
        Wireless:  en1: 802.11 a/b/g/n
        Battery Health: Normal - Cycle count 130
    Video Information: ℹ️
        Intel HD Graphics 4000
            Color LCD 1440 x 900
        NVIDIA GeForce GT 650M - VRAM: 1024 MB
    System Software: ℹ️
        OS X 10.10.2 (14C109) - Time since boot: 0:12:52
    Disk Information: ℹ️
        APPLE HDD HTS547575A9E384 disk0 : (750.16 GB)
            EFI (disk0s1) <not mounted> : 210 MB
            Recovery HD (disk0s3) <not mounted>  [Recovery]: 650 MB
            Macintosh HD (disk1) / : 748.93 GB (362.64 GB free)
                Core Storage: disk0s2 749.30 GB Online
        MATSHITADVD-R   UJ-8A8 
    USB Information: ℹ️
        Apple Inc. FaceTime HD Camera (Built-in)
        Apple Inc. Apple Internal Keyboard / Trackpad
        Apple Computer, Inc. IR Receiver
        Apple Inc. BRCM20702 Hub
            Apple Inc. Bluetooth USB Host Controller
    Thunderbolt Information: ℹ️
        Apple Inc. thunderbolt_bus
    Gatekeeper: ℹ️
        Mac App Store and identified developers
    Kernel Extensions: ℹ️
            /System/Library/Extensions
        [not loaded]    com.AmbrosiaSW.AudioSupport (4.1.2 - SDK 10.6) [Click for support]
        [not loaded]    com.sony.filesystem.prodisc_fs (2.3.0) [Click for support]
        [not loaded]    com.sony.protocol.prodisc (2.3.0) [Click for support]
    Launch Daemons: ℹ️
        [loaded]    com.adobe.fpsaud.plist [Click for support]
        [loaded]    com.adobe.versioncueCS3.plist [Click for support]
        [loaded]    com.ambrosiasw.ambrosiaaudiosupporthelper.daemon.plist [Click for support]
    User Launch Agents: ℹ️
        [failed]    [email protected] [Click for details]
        [loaded]    com.google.keystone.agent.plist [Click for support]
        [failed]    com.jdibackup.ZipCloud.autostart.plist [Click for support] [Click for details]
        [loaded]    com.jdibackup.ZipCloud.notify.plist [Click for support]
    User Login Items: ℹ️
        RED Watchdog    Application  (/Applications/REDCINE-X Professional/Utilities/RED Watchdog.app)
        GrowlHelperApp    Application  (/Library/PreferencePanes/Growl.prefPane/Contents/Resources/GrowlHelperApp.app)
        GrowlHelperApp    Application  (/Users/[redacted]/Library/PreferencePanes/Growl.prefPane/Contents/Resources/Gr owlHelperApp.app)
        iTunesHelper    UNKNOWN Hidden (missing value)
        QmasterStatusMenu    Application  (/Incompatible Software/Apple Qmaster.prefPane/Contents/Resources/QmasterStatusMenu.app)
        SpyderUtility    Application  (/Applications/Datacolor/Spyder3Elite/Support/SpyderUtility.app)
        Spyder3Utility    Application  (/Applications/Datacolor/Spyder3Elite/Spyder3Utility.app)
        Google Drive    Application  (/Applications/Google Drive.app)
        Google Chrome    Application Hidden (/Applications/Google Chrome.app)
    Internet Plug-ins: ℹ️
        JavaAppletPlugin: Version: 15.0.0 - SDK 10.10 Check version
        FlashPlayer-10.6: Version: 16.0.0.305 - SDK 10.6 [Click for support]
        QuickTime Plugin: Version: 7.7.3
        Flash Player: Version: 16.0.0.305 - SDK 10.6 [Click for support]
        AdobePDFViewer: Version: 8.1.0 [Click for support]
        Default Browser: Version: 600 - SDK 10.10
        Silverlight: Version: 5.1.30514.0 - SDK 10.6 [Click for support]
        iPhotoPhotocast: Version: 7.0
    User internet Plug-ins: ℹ️
        Google Earth Web Plug-in: Version: 7.0 [Click for support]
    Audio Plug-ins: ℹ️
        DVCPROHDAudio: Version: 1.3.2
    3rd Party Preference Panes: ℹ️
        Adobe Version Cue CS3  [Click for support]
        Flash Player  [Click for support]
        Growl  [Click for support]
        REDcode  [Click for support]
    Time Machine: ℹ️
        Time Machine not configured!
    Top Processes by CPU: ℹ️
            10%    mds
             5%    WindowServer
             0%    Google Drive
             0%    Google Chrome
             0%    fontd
    Top Processes by Memory: ℹ️
        172 MB    Google Chrome
        155 MB    mds_stores
        155 MB    Mail
        103 MB    Google Chrome Helper
        94 MB    Google Drive
    Virtual Memory Information: ℹ️
        4.52 GB    Free RAM
        2.72 GB    Active RAM
        451 MB    Inactive RAM
        895 MB    Wired RAM
        1.30 GB    Page-ins
        0 B    Page-outs
    Diagnostics Information: ℹ️
        Feb 19, 2015, 03:03:40 PM    Self test - passed

    Why Put it off I say ... Here you go Linc
    Start time: 12:05:29 02/20/15
    Revision: 1250
    Model Identifier: MacBookPro9,1
    System Version: OS X 10.10.2 (14C109)
    Kernel Version: Darwin 14.1.0
    Time since boot: 2:42
    UID: 504
    I/O wait time (ms/s)
        kernel_task (UID 0): 39
    Font issues: 263
    Trust settings: admin 4, user 4
    TCP/IP
        Subnet mask: 255.255.252.0
    Listeners
        cupsd: ipp
        nfsd: 1023
        rpc.lockd: 1017
        rpc.rquotad: garcon
        rpc.statd: exp1
        rpcbind: sunrpc
    System caches/logs
        3319 MB: /System/Library/Caches/com.apple.coresymbolicationd/data
    Diagnostic reports
        2015-02-02 Mail crash
        2015-02-04 Spyder3Utility crash
        2015-02-20 Acrobat hang x3
        2015-02-20 Final Cut Pro crash x2
    HID errors: 22
    Kernel log
        Feb 20 10:20:53 Google Chrome He (map: 0xffffff801e1b7c30) triggered DYLD shared region unnest for map: 0xffffff801e1b7c30, region 0x7fff8aa00000->0x7fff8ac00000. While not abnormal for debuggers, this increases system memory footprint until the target exits.
        Feb 20 10:31:10 ARPT: 3921.321063: MacAuthEvent en1   Auth result for: 00:19:92:35:03:01 Auth request tx failed
        Feb 20 10:41:10 Google Chrome He (map: 0xffffff801e116870) triggered DYLD shared region unnest for map: 0xffffff801e116870, region 0x7fff8aa00000->0x7fff8ac00000. While not abnormal for debuggers, this increases system memory footprint until the target exits.
        Feb 20 10:41:14 Google Chrome He (map: 0xffffff802265ee10) triggered DYLD shared region unnest for map: 0xffffff802265ee10, region 0x7fff8aa00000->0x7fff8ac00000. While not abnormal for debuggers, this increases system memory footprint until the target exits.
        Feb 20 10:41:30 Google Chrome He (map: 0xffffff802265ee10) triggered DYLD shared region unnest for map: 0xffffff802265ee10, region 0x7fff8aa00000->0x7fff8ac00000. While not abnormal for debuggers, this increases system memory footprint until the target exits.
        Feb 20 11:20:59 Google Chrome (map: 0xffffff801e116870) triggered DYLD shared region unnest for map: 0xffffff801e116870, region 0x7fff8aa00000->0x7fff8ac00000. While not abnormal for debuggers, this increases system memory footprint until the target exits.
        Feb 20 11:20:59 Google Chrome He (map: 0xffffff802b72a960) triggered DYLD shared region unnest for map: 0xffffff802b72a960, region 0x7fff8aa00000->0x7fff8ac00000. While not abnormal for debuggers, this increases system memory footprint until the target exits.
        Feb 20 11:20:59 Google Chrome He (map: 0xffffff802b72a3c0) triggered DYLD shared region unnest for map: 0xffffff802b72a3c0, region 0x7fff8aa00000->0x7fff8ac00000. While not abnormal for debuggers, this increases system memory footprint until the target exits.
        Feb 20 11:20:59 Google Chrome He (map: 0xffffff8023819f00) triggered DYLD shared region unnest for map: 0xffffff8023819f00, region 0x7fff8aa00000->0x7fff8ac00000. While not abnormal for debuggers, this increases system memory footprint until the target exits.
        Feb 20 11:21:01 Google Chrome He (map: 0xffffff802cdb0e10) triggered DYLD shared region unnest for map: 0xffffff802cdb0e10, region 0x7fff8aa00000->0x7fff8ac00000. While not abnormal for debuggers, this increases system memory footprint until the target exits.
        Feb 20 11:21:01 Google Chrome He (map: 0xffffff8022da2e10) triggered DYLD shared region unnest for map: 0xffffff8022da2e10, region 0x7fff8aa00000->0x7fff8ac00000. While not abnormal for debuggers, this increases system memory footprint until the target exits.
        Feb 20 11:21:01 Google Chrome He (map: 0xffffff8023819b40) triggered DYLD shared region unnest for map: 0xffffff8023819b40, region 0x7fff8aa00000->0x7fff8ac00000. While not abnormal for debuggers, this increases system memory footprint until the target exits.
        Feb 20 11:30:46 Sandbox: fontworker(1439) deny file-read-data /Library/Fonts/MyriadPro-LightCond.otf
        Feb 20 11:30:46 Sandbox: fontworker(1439) deny file-read-data /Library/Fonts/MyriadPro-LightCondIt.otf
        Feb 20 11:49:11 Google Chrome (map: 0xffffff802b72a2d0) triggered DYLD shared region unnest for map: 0xffffff802b72a2d0, region 0x7fff8aa00000->0x7fff8ac00000. While not abnormal for debuggers, this increases system memory footprint until the target exits.
        Feb 20 11:49:11 Google Chrome He (map: 0xffffff802cdb0780) triggered DYLD shared region unnest for map: 0xffffff802cdb0780, region 0x7fff8aa00000->0x7fff8ac00000. While not abnormal for debuggers, this increases system memory footprint until the target exits.
        Feb 20 11:49:11 Google Chrome He (map: 0xffffff8022a63e10) triggered DYLD shared region unnest for map: 0xffffff8022a63e10, region 0x7fff8aa00000->0x7fff8ac00000. While not abnormal for debuggers, this increases system memory footprint until the target exits.
        Feb 20 11:49:11 Google Chrome He (map: 0xffffff8022a63c30) triggered DYLD shared region unnest for map: 0xffffff8022a63c30, region 0x7fff8aa00000->0x7fff8ac00000. While not abnormal for debuggers, this increases system memory footprint until the target exits.
        Feb 20 11:49:11 Google Chrome He (map: 0xffffff802cdb05a0) triggered DYLD shared region unnest for map: 0xffffff802cdb05a0, region 0x7fff8aa00000->0x7fff8ac00000. While not abnormal for debuggers, this increases system memory footprint until the target exits.
        Feb 20 11:49:11 Google Chrome He (map: 0xffffff8022a63f00) triggered DYLD shared region unnest for map: 0xffffff8022a63f00, region 0x7fff8aa00000->0x7fff8ac00000. While not abnormal for debuggers, this increases system memory footprint until the target exits.
        Feb 20 11:49:11 Google Chrome He (map: 0xffffff8022a63690) triggered DYLD shared region unnest for map: 0xffffff8022a63690, region 0x7fff8aa00000->0x7fff8ac00000. While not abnormal for debuggers, this increases system memory footprint until the target exits.
        Feb 20 11:59:29 Sandbox: fontworker(1671) deny file-read-data /Library/Fonts/MyriadPro-LightCond.otf
        Feb 20 11:59:29 Sandbox: fontworker(1671) deny file-read-data /Library/Fonts/MyriadPro-LightCondIt.otf
        Feb 20 12:08:01 ARPT: 8890.600067: MacAuthEvent en1   Auth result for: 00:19:92:35:7d:e1 Auth request tx failed
        Feb 20 12:08:01 ARPT: 8890.950534: MacAuthEvent en1   Auth result for: 00:19:92:35:03:01 Auth timed out
    System log
        Feb 20 11:24:49 WindowServer: CGXGetConnectionProperty: Invalid connection 125827
        Feb 20 11:24:49 WindowServer: CGXGetConnectionProperty: Invalid connection 125827
        Feb 20 11:24:49 WindowServer: CGXGetConnectionProperty: Invalid connection 125827
        Feb 20 11:24:49 WindowServer: CGXGetConnectionProperty: Invalid connection 125827
        Feb 20 11:24:49 WindowServer: CGXGetConnectionProperty: Invalid connection 125827
        Feb 20 11:25:05 airportd: _handleLinkEvent: WiFi is not powered. Resetting state variables.
        Feb 20 11:28:01 WindowServer: WSGetSurfaceInWindow Invalid surface 489574406 for window 1303
        Feb 20 11:28:01 WindowServer: WSGetSurfaceInWindow Invalid surface 489574406 for window 1303
        Feb 20 11:28:01 WindowServer: WSGetSurfaceInWindow Invalid surface 489574406 for window 1303
        Feb 20 11:28:49 WindowServer: WSBindSurface Invalid surface 723885656 for window 1311
        Feb 20 11:29:13 fseventsd: event logs in /Volumes/WDA_1T/.fseventsd out of sync with volume.  destroying old logs. (461 2 59825)
        Feb 20 11:29:13 fseventsd: log dir: /Volumes/WDA_1T/.fseventsd getting new uuid: UUID
        Feb 20 11:30:16 bird: Assertion failed: ![_xpcClients containsObject:client]
        Feb 20 11:30:16 bird: Assertion failed: ![_xpcClients containsObject:client]
        Feb 20 11:32:32 bird: Assertion failed: ![_xpcClients containsObject:client]
        Feb 20 11:32:32 bird: Assertion failed: ![_xpcClients containsObject:client]
        Feb 20 11:32:32 bird: Assertion failed: ![_xpcClients containsObject:client]
        Feb 20 11:36:11 WindowServer: _CGXSetWindowHasKeyAppearance: Operation on a window 0x18 requiring rights kCGSWindowRightOwner by caller Dashboard
        Feb 20 11:36:11 WindowServer: _CGXSetWindowHasMainAppearance: Operation on a window 0x18 requiring rights kCGSWindowRightOwner by caller Dashboard
        Feb 20 11:41:24 apsd: Failed entitlement check 'com.apple.private.aps-connection-initiate' for ManagedClientAgent[1532]
        Feb 20 11:43:40 Mail: CoreText CopyFontsForRequest received mig IPC error (FFFFFFFFFFFFFECC) from font server
        Feb 20 11:43:40 Mail: CoreText CopyFontsForRequest received mig IPC error (FFFFFFFFFFFFFECC) from font server
        Feb 20 12:01:17 WindowServer: WSGetSurfaceInWindow Invalid surface 710322265 for window 1327
        Feb 20 12:04:39 fseventsd: implementation_removed_client: did not find client 0x7f9eec210660 for path = '/.docid'
        Feb 20 12:11:28 apsd: Failed entitlement check 'com.apple.private.aps-connection-initiate' for ManagedClientAgent[2262]
    Console log
        Feb 15 12:07:08 ReportCrash: Invoking spindump for pid=644 wakeups_rate=158 duration=285 because of excessive wakeups
        Feb 15 12:55:36 ReportCrash: Invoking spindump for pid=754 wakeups_rate=200 duration=225 because of excessive wakeups
        Feb 15 13:59:55 ReportCrash: Invoking spindump for pid=913 wakeups_rate=186 duration=242 because of excessive wakeups
        Feb 15 16:54:59 ReportCrash: Invoking spindump for pid=964 wakeups_rate=188 duration=240 because of excessive wakeups
        Feb 16 10:35:10 ReportCrash: Invoking spindump for pid=1059 wakeups_rate=337 duration=134 because of excessive wakeups
        Feb 16 10:51:21 ReportCrash: Invoking spindump for pid=1080 wakeups_rate=161 duration=280 because of excessive wakeups
        Feb 16 11:59:13 ReportCrash: Invoking spindump for pid=1168 wakeups_rate=243 duration=186 because of excessive wakeups
        Feb 16 12:02:57 ReportCrash: Invoking spindump for pid=1175 wakeups_rate=382 duration=118 because of excessive wakeups
        Feb 16 13:07:53 nsurlstoraged: The read-connection to the DB=/Users/USER/Library/Caches/com.ic.searchinstaller/Cache.db is NOT valid.  Unable to determine schema version.
        Feb 16 13:07:53 nsurlstoraged: ERROR: unable to determine file-system usage for FS-backed cache at /Users/USER/Library/Caches/com.ic.searchinstaller/fsCachedData. Errno=13
        Feb 16 13:22:31 ReportCrash: Invoking spindump for pid=2237 wakeups_rate=326 duration=139 because of excessive wakeups
        Feb 16 14:17:37 ReportCrash: Invoking spindump for pid=2420 wakeups_rate=228 duration=198 because of excessive wakeups
        Feb 16 14:33:29 ReportCrash: Invoking spindump for pid=2438 wakeups_rate=240 duration=188 because of excessive wakeups
        Feb 16 14:46:36 ReportCrash: Invoking spindump for pid=2454 wakeups_rate=305 duration=148 because of excessive wakeups
        Feb 17 12:58:26 ReportCrash: Invoking spindump for pid=2894 wakeups_rate=689 duration=66 because of excessive wakeups
        Feb 17 13:13:41 ReportCrash: Invoking spindump for pid=2914 wakeups_rate=487 duration=93 because of excessive wakeups
        Feb 17 16:54:57 ReportCrash: Invoking spindump for pid=1965 wakeups_rate=162 duration=278 because of excessive wakeups
        Feb 18 13:50:58 ReportCrash: Invoking spindump for pid=3869 wakeups_rate=160 duration=282 because of excessive wakeups
        Feb 19 08:17:10 nsurlstoraged: The read-connection to the DB=/Users/USER/Library/Caches/com.apple.icloud.fmfd/Cache.db is NOT valid.  Unable to determine schema version.
        Feb 19 14:59:30 nsurlstoraged: The read-connection to the DB=/Users/USER/Library/Caches/com.apple.icloud.fmfd/Cache.db is NOT valid.  Unable to determine schema version.
        Feb 19 15:04:57 nsurlstoraged: The read-connection to the DB=/Users/USER/Library/Caches/com.apple.icloud.fmfd/Cache.db is NOT valid.  Unable to determine schema version.
        Feb 19 15:18:06 osascript: Error loading /Library/ScriptingAdditions/Adobe Unit Types.osax/Contents/MacOS/Adobe Unit Types:  dlopen(/Library/ScriptingAdditions/Adobe Unit Types.osax/Contents/MacOS/Adobe Unit Types, 262): no suitable image found.  Did find:
        /Library/ScriptingAdditions/Adobe Unit Types.osax/Contents/MacOS/Adobe Unit Types: no matching architecture in universal wrapper
        Feb 19 16:50:23 ReportCrash: Invoking spindump for pid=3308 wakeups_rate=189 duration=239 because of excessive wakeups
        Feb 20 09:24:49 nsurlstoraged: The read-connection to the DB=/Users/USER/Library/Caches/com.apple.icloud.fmfd/Cache.db is NOT valid.  Unable to determine schema version.
    Daemons
        com.adobe.fpsaud
        com.adobe.versioncueCS3
        com.ambrosiasw.ambrosiaaudiosupporthelper.daemon
        com.apple.watchdogd
    Agents
        [email protected]
        - status: 78
        com.apple.Finder
        - status: -15
        com.google.keystone.user.agent
        com.jdibackup.ZipCloud.autostart
        - status: 1
        com.jdibackup.ZipCloud.notify
        - status: 1
    User login items
        RED Watchdog
        - /Applications/REDCINE-X Professional/Utilities/RED Watchdog.app
        GrowlHelperApp
        - /Library/PreferencePanes/Growl.prefPane/Contents/Resources/GrowlHelperApp.app
        GrowlHelperApp
        - /Users/USER/Library/PreferencePanes/Growl.prefPane/Contents/Resources/GrowlHelp erApp.app
        iTunesHelper
        - missing value
        QmasterStatusMenu
        - /Incompatible Software/Apple Qmaster.prefPane/Contents/Resources/QmasterStatusMenu.app
        SpyderUtility
        - /Applications/Datacolor/Spyder3Elite/Support/SpyderUtility.app
        Spyder3Utility
        - /Applications/Datacolor/Spyder3Elite/Spyder3Utility.app
        Google Drive
        - /Applications/Google Drive.app
        Google Chrome
        - /Applications/Google Chrome.app
    Firefox extensions
        Live PageRank
        Web Developer
        Exif Viewer
    iCloud errors
        bird 418
        cloudd 65
    Continuity errors
        sharingd 21
    Restricted files: 335
    Lockfiles: 48
    Contents of /Library/LaunchDaemons/com.adobe.versioncueCS3.plist
        - mod date: Oct 20 14:05:00 2009
        - checksum: 714202969
        <?xml version="1.0" encoding="UTF-8"?>
        <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
        <plist version="1.0">
        <dict>
        <key>GroupName</key>
        <string>wheel</string>
        <key>Label</key>
        <string>com.adobe.versioncueCS3</string>
        <key>OnDemand</key>
        <true/>
        <key>ProgramArguments</key>
        <array>
        <string>/Library/Application Support/Adobe/Adobe Version Cue CS3/Server/bin/VersionCueCS3d</string>
        </array>
        <key>RunAtLoad</key>
        <false/>
        <key>ServiceDescription</key>
        <string>Adobe Version Cue CS3</string>
        <key>UserName</key>
        <string>root</string>
        </dict>
        </plist>
    Contents of /Library/LaunchDaemons/com.ambrosiasw.ambrosiaaudiosupporthelper.daemon.plist
        - mod date: Dec 21 11:32:33 2012
        - checksum: 1980407752
        <?xml version="1.0" encoding="UTF-8"?>
        <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
        <plist version="1.0">
        <dict>
        <key>Label</key>
        <string>com.ambrosiasw.ambrosiaaudiosupporthelper.daemon</string>
        <key>ProgramArguments</key>
        <array>
        <string>/System/Library/Extensions/AmbrosiaAudioSupport.kext/Contents/MacOS/amb rosiaaudiosupporthelper</string>
        </array>
        <key>KeepAlive</key>
        <false/>
        <key>Disabled</key>
        <false/>
        <key>LaunchEvents</key>
        <dict>
        <key>com.apple.iokit.matching</key>
        <dict>
        <key>AmbrosiaAudioSupport</key>
        <dict>
        <key>IOMatchLaunchStream</key>
        <true/>
        <key>IOProviderClass</key>
        <string>com_AmbrosiaSW_AudioSupport</string>
        </dict>
        ...and 4 more line(s)
    Contents of /Library/LaunchDaemons/com.apple.qmaster.qmasterd.plist
        - mod date: Aug 25 21:24:23 2010
        - checksum: 681742547
        <?xml version="1.0" encoding="UTF-8"?>
        <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
        <plist version="1.0">
        <dict>
        <key>Label</key>
        <string>com.apple.qmaster.qmasterd</string>
        <key>ProgramArguments</key>
        <array>
        <string>/usr/sbin/qmasterd</string>
        </array>
        <key>OnDemand</key>
        <false/>
        </dict>
        </plist>
    Contents of /private/etc/hosts
        - mod date: Sep 20 11:46:00 2013
        - checksum: 1921340845
        127.0.0.1 localhost
        255.255.255.255 broadcasthost
        ::1             localhost
        fe80::1%lo0 localhost
    Contents of Library/LaunchAgents/[email protected]
        - mod date: Sep 15 12:18:45 2009
        - checksum: 2526625188
        <?xml version="1.0" encoding="UTF-8"?>
        <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
        <plist version="1.0">
        <dict>
        <key>KeepAlive</key>
        <false/>
        <key>Label</key>
        <string>[email protected]</string>
        <key>LimitLoadToSessionType</key>
        <string>Aqua</string>
        <key>LowPriorityIO</key>
        <true/>
        <key>Nice</key>
        <integer>10</integer>
        <key>ProgramArguments</key>
        <array>
        <string>/System/Library/Frameworks/CoreServices.framework/Frameworks/OSServices .framework/Versions/A/Support/CSConfigDotMacCert</string>
        <string>-l</string>
        <string>/Users/USER/Library/Logs/[email protected]</string>
        <string>-u</string>
        <string>@me.com</string>
        <string>-t</string>
        <string>SharedServices</string>
        <string>-s</string>
        </array>
        ...and 4 more line(s)
    Contents of Library/LaunchAgents/com.google.keystone.agent.plist
        - mod date: Nov 28 13:56:29 2014
        - checksum: 3826001454
        <?xml version="1.0" encoding="UTF-8"?>
        <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
        <plist version="1.0">
        <dict>
        <key>Label</key>
        <string>com.google.keystone.user.agent</string>
        <key>LimitLoadToSessionType</key>
        <string>Aqua</string>
        <key>ProgramArguments</key>
        <array>
         <string>/Users/USER/Library/Google/GoogleSoftwareUpdate/GoogleSoftwareUpdate.bu ndle/Contents/Resources/GoogleSoftwareUpdateAgent.app/Contents/MacOS/GoogleSoftw areUpdateAgent</string>
         <string>-runMode</string>
         <string>ifneeded</string>
        </array>
        <key>RunAtLoad</key>
        <true/>
        <key>StartInterval</key>
        <integer>3523</integer>
        <key>StandardErrorPath</key>
        <string>/dev/null</string>
        <key>StandardOutPath</key>
        <string>/dev/null</string>
        </dict>
        </plist>
    Contents of Library/LaunchAgents/com.jdibackup.ZipCloud.autostart.plist
        - mod date: Feb 19 15:00:08 2015
        - checksum: 2356528749
        <?xml version="1.0" encoding="UTF-8"?>
        <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
        <plist version="1.0">
        <dict>
            <key>Label</key>
            <string>com.jdibackup.ZipCloud.autostart</string>
            <key>ProgramArguments</key>
            <array>
                <string>open</string>
                <string>/Applications/ZipCloud.app/Contents/Resources/Utility.app</string>
                <string>-n</string>
                <string>--args</string>
                <string>9</string>
                <string>-l</string>
            </array>
            <key>StandardOutPath</key>
            <string>/Users/USER/Library/Logs/ZipCloud/lagent_out.log</string>
            <key>StandardErrorPath</key>
            <string>/Users/USER/Library/Logs/ZipCloud/lagent_err.log</string>
            <key>RunAtLoad</key>
            <true/>
        </dict>
        </plist>
    Contents of Library/LaunchAgents/com.jdibackup.ZipCloud.notify.plist
        - mod date: Feb 19 15:00:08 2015
        - checksum: 1841511774
        <?xml version="1.0" encoding="UTF-8"?>
        <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
        <plist version="1.0">
        <dict>
            <key>Label</key>
            <string>com.jdibackup.ZipCloud.notify</string>
            <key>ProgramArguments</key>
            <array>
                <string>open</string>
                <string>/Applications/ZipCloud.app/Contents/Resources/Utility.app</string>
                <string>--args</string>
                <string>7</string>
                <string>1</string>
            </array>
            <key>StandardOutPath</key>
            <string>/Users/USER/Library/Logs/ZipCloud/lagent_out.log</string>
            <key>StandardErrorPath</key>
            <string>/Users/USER/Library/Logs/ZipCloud/lagent_err.log</string>
            <key>StartInterval</key>
            <integer>1200</integer>
            <key>RunAtLoad</key>
            <false/>
        </dict>
        </plist>
    Extensions
        /System/Library/Extensions/AmbrosiaAudioSupport.kext
        - com.AmbrosiaSW.AudioSupport
        /System/Library/Extensions/FAMProtocol.kext
        - com.sony.protocol.prodisc
        /System/Library/Extensions/JMicronATA.kext
        - com.jmicron.JMicronATA
        /System/Library/Extensions/prodisc_fs.kext
        - com.sony.filesystem.prodisc_fs
    Applications
        /Applications/Adobe Acrobat 8 Professional/Acrobat Distiller.app
        - com.adobe.distiller
        /Applications/Adobe Acrobat 8 Professional/Acrobat Uninstaller.app
        - com.adobe.Acrobat.Uninstaller
        /Applications/Adobe Acrobat 8 Professional/Adobe Acrobat Professional.app
        - com.adobe.Acrobat.Pro
        /Applications/Adobe Bridge CS3/Bridge CS3.app
        - com.adobe.bridge2
        /Applications/Adobe Device Central CS3/Device Central.app
        - com.adobe.devicecentral.application
        /Applications/Adobe Dreamweaver CS3/Dreamweaver.app
        - com.adobe.dreamweaver-9.0
        /Applications/Adobe Extension Manager/Extension Manager.app
        - com.adobe.ExtensionManager
        /Applications/Adobe Fireworks CS3/Adobe Fireworks CS3.app
        - com.macromedia.fireworks
        /Applications/Adobe Flash CS3 Video Encoder/Adobe Flash CS3 Video Encoder.app
        - com.macromedia.FLVEncoder
        /Applications/Adobe Flash CS3/Adobe Flash CS3.app
        - com.adobe.flash-9.0-en_us
        /Applications/Adobe Flash CS3/Players/Debug/Flash Player.app
        - com.macromedia.Flash Player.app
        /Applications/Adobe Flash CS3/Players/Debug/Install Flash Player 9 UB.app
        - com.MindVision.VISEX
        /Applications/Adobe Flash CS3/Players/Flash Player.app
        - com.macromedia.Flash Player.app
        /Applications/Adobe Flash CS3/Players/Release/Flash Player.app
        - com.macromedia.Flash Player.app
        /Applications/Adobe Flash CS3/Players/Release/Install Flash Player 9 UB.app
        - com.MindVision.VISEX
        /Applications/Adobe Help Viewer 1.0.app
        - com.adobe.Adobe Help Viewer
        /Applications/Adobe Help Viewer 1.1.app
        - com.adobe.Adobe Help Viewer
        /Applications/Adobe Illustrator CS3/Adobe Illustrator.app
        - com.adobe.illustrator
        /Applications/Adobe Illustrator CS3/Scripting.localized/Sample Scripts.localized/AppleScript/Analyze Documents.localized/Analyze Documents.app
        - N/A
        /Applications/Adobe Illustrator CS3/Scripting.localized/Sample Scripts.localized/AppleScript/Calendar.localized/Make Calendar.app
        - N/A
        /Applications/Adobe Illustrator CS3/Scripting.localized/Sample Scripts.localized/AppleScript/Collect for Output.localized/Collect for Output.app
        - N/A
        /Applications/Adobe Illustrator CS3/Scripting.localized/Sample Scripts.localized/AppleScript/Contact Sheet Demo.localized/Contact Sheets.app
        - N/A
        /Applications/Adobe Illustrator CS3/Scripting.localized/Sample Scripts.localized/AppleScript/Export Flash Animation.localized/Export Flash Animation.app
        - N/A
        /Applications/Adobe Illustrator CS3/Scripting.localized/Sample Scripts.localized/AppleScript/Web Gallery.localized/Web Gallery.app
        - N/A
        /Applications/Adobe Photoshop CS3/Adobe Photoshop CS3.app
        - com.adobe.Photoshop
        /Applications/Adobe Premiere Pro CS3/Adobe Premiere Pro CS3.app
        - com.adobe.AdobePremierePro
        /Applications/Adobe Stock Photos CS3/Adobe Stock Photos CS3.app
        - com.adobe.stockphotos-1.5
        /Applications/Audacity/Audacity.app
        - net.sourceforge.audacity
        /Applications/Beak.app
        - com.flyosity.beak
        /Applications/Buzzbird.app
        - org.buzzbird.buzzbird
        /Applications/Celtx.app
        - ca.greyfirst.celtx
        /Applications/Datacolor/Spyder3Elite/Spyder3Elite.app
        - com.datacolor.spyder3elite
        /Applications/Datacolor/Spyder3Elite/Spyder3Utility.app
        - com.datacolor.spyder3utility
        /Applications/Datacolor/Spyder3Elite/Support/SpyderUtility.app
        - com.datacolor.spyderutility
        /Applications/Disk Inventory X.app
        - com.derlien.DiskInventoryX
        /Applications/Epson Software/Print CD/Print CD.app
        - jp.co.epson.PrintCD2
        /Applications/FileZilla.app
        - de.filezilla
        /Applications/FlashVideo Converter.app
        - com.geovid.
        /Applications/Gorilla Folder/Gorilla Program 4.0.0/Gorilla 4.0.0
        - N/A
        /Applications/HandBrake.app
        - org.m0k.handbrake
        /Applications/Levelator.app
        - org.conversationsnetwork.levelator
        /Applications/OpenOffice.org.app
        - org.openoffice.script
        /Applications/RecBoot.app
        - com.lepidu.RecBoot
        /Applications/Smultron.app
        - org.smultron.Smultron
        /Applications/TouchCopy.app
        - N/A
        /Applications/Uninstall MM Scheduling/Uninstall MM Scheduling.app
        - N/A
        /Applications/Utilities/Adobe Utilities.localized/Adobe Updater5/Adobe Updater.app
        - "com.Adobe.ESD.AdobeUpdaterApplication"
        /Applications/Utilities/Adobe Utilities.localized/ExtendScript Toolkit 2/ExtendScript Toolkit 2.app
        - com.adobe.estoolkit-2.0
        /Applications/Utilities/Bluetooth Firmware Update.app
        - com.apple.updaters.btfirmwareupdate201
        /Applications/Utilities/FAM Driver Tool.app
        - com.sony.famdrivertool
        /Applications/VLC.app
        - org.videolan.vlc
        /Applications/XDCAM Transfer.app
        - com.sony.bprl.xdcamtransfer
        /Applications/YouSendIt Desktop App.app
        - com.yousendit.YouSendIt
        /Applications/YouSendIt.app
        - com.yousendit.YouSendItExpress
        /Applications/gedit.app
        - org.gnome.gedit
        /Applications/iWork '08/Keynote.app
        - com.apple.iWork.Keynote
        /Applications/iWork '08/Numbers.app
        - com.apple.iWork.Numbers
        /Applications/iWork '08/Pages.app
        - com.apple.iWork.Pages
        /Developer/Applications/Utilities/MacPython 2.5/Build Applet.app
        - org.python.buildapplet
        /Developer/Applications/Utilities/Python 2.6/Build Applet.app
        - org.python.buildapplet
        /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.2.sdk/System/Li brary/CoreServices/MobileStorageMounter.app
        - N/A
        /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.2.sdk/System/Li brary/CoreServices/SpringBoard.app
        - N/A
        /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.2.sdk/System/Li brary/CoreServices/VoiceOverTouch.app
        - N/A
        /Developer/Platforms/iPhoneOS.platform/DeviceSupport/3.0/Symbols/System/Library /CoreServices/SpringBoard.app
        - N/A
        /Developer/Platforms/iPhoneOS.platform/DeviceSupport/3.0/Symbols/System/Library /CoreServices/VoiceOverTouch.app
        - N/A
        /Developer/Platforms/iPhoneOS.platform/DeviceSupport/3.1.2/Symbols/System/Libra ry/CoreServices/SpringBoard.app
        - N/A
        /Developer/Platforms/iPhoneOS.platform/DeviceSupport/3.1.2/Symbols/System/Libra ry/CoreServices/VoiceOverTouch.app
        - N/A
        /Developer/Platforms/iPhoneOS.platform/DeviceSupport/3.1.3/Symbols/System/Libra ry/CoreServices/SpringBoard.app
        - N/A
        /Developer/Platforms/iPhoneOS.platform/DeviceSupport/3.1.3/Symbols/System/Libra ry/CoreServices/VoiceOverTouch.app
        - N/A
        /Developer/Platforms/iPhoneOS.platform/DeviceSupport/3.1/Symbols/System/Library /CoreServices/SpringBoard.app
        - N/A
        /Developer/Platforms/iPhoneOS.platform/DeviceSupport/3.1/Symbols/System/Library /CoreServices/VoiceOverTouch.app
        - N/A
        /Developer/Platforms/iPhoneOS.platform/DeviceSupport/3.2.1/Symbols/System/Libra ry/CoreServices/MobileStorageMounter.app
        - N/A
        /Developer/Platforms/iPhoneOS.platform/DeviceSupport/3.2.1/Symbols/System/Libra ry/CoreServices/SpringBoard.app
        - N/A
        /Developer/Platforms/iPhoneOS.platform/DeviceSupport/3.2.1/Symbols/System/Libra ry/CoreServices/VoiceOverTouch.app
        - N/A
        /Developer/Platforms/iPhoneOS.platform/DeviceSupport/3.2.2/Symbols/System/Libra ry/CoreServices/MobileStorageMounter.app
        - N/A
        /Developer/Platforms/iPhoneOS.platform/DeviceSupport/3.2.2/Symbols/System/Libra ry/CoreServices/SpringBoard.app
        - N/A
        /Developer/Platforms/iPhoneOS.platform/DeviceSupport/3.2.2/Symbols/System/Libra ry/CoreServices/VoiceOverTouch.app
        - N/A
        /Developer/Platforms/iPhoneOS.platform/DeviceSupport/3.2/Symbols/System/Library /CoreServices/MobileStorageMounter.app
        - N/A
        /Developer/Platforms/iPhoneOS.platform/DeviceSupport/3.2/Symbols/System/Library /CoreServices/SpringBoard.app
        - N/A
        /Developer/Platforms/iPhoneOS.platform/DeviceSupport/3.2/Symbols/System/Library /CoreServices/VoiceOverTouch.app
        - N/A
        /Developer/Platforms/iPhoneOS.platform/DeviceSupport/4.0.1/Symbols/System/Libra ry/CoreServices/MobileStorageMounter.app
        - N/A
        /Developer/Platforms/iPhoneOS.platform/DeviceSupport/4.0.1/Symbols/System/Libra ry/CoreServices/SpringBoard.app
        - N/A
        /Developer/Platforms/iPhoneOS.platform/DeviceSupport/4.0.1/Symbols/System/Libra ry/CoreServices/VoiceOverTouch.app
        - N/A
        /Developer/Platforms/iPhoneOS.platform/DeviceSupport/4.0.2/Symbols/System/Libra ry/CoreServices/MobileStorageMounter.app
        - N/A
        /Developer/Platforms/iPhoneOS.platform/DeviceSupport/4.0.2/Symbols/System/Libra ry/CoreServices/SpringBoard.app
        - N/A
        /Developer/Platforms/iPhoneOS.platform/DeviceSupport/4.0.2/Symbols/System/Libra ry/CoreServices/VoiceOverTouch.app
        - N/A
        /Developer/Platforms/iPhoneOS.platform/DeviceSupport/4.0/Symbols/System/Library /CoreServices/MobileStorageMounter.app
        - N/A
        /Developer/Platforms/iPhoneOS.platform/DeviceSupport/4.0/Symbols/System/Library /CoreServices/SpringBoard.app
        - N/A
        /Developer/Platforms/iPhoneOS.platform/DeviceSupport/4.0/Symbols/System/Library /CoreServices/VoiceOverTouch.app
        - N/A
        /Developer/Platforms/iPhoneOS.platform/DeviceSupport/4.1/Symbols/System/Library /CoreServices/MobileStorageMounter.app
        - N/A
        /Developer/Platforms/iPhoneOS.platform/DeviceSupport/4.1/Symbols/System/Library /CoreServices/SpringBoard.app
        - N/A
        /Developer/Platforms/iPhoneOS.platform/DeviceSupport/4.1/Symbols/System/Library /CoreServices/VoiceOverTouch.app
        - N/A
        /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.2 .sdk/Applications/MobileAddressBook.app
        - N/A
        /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.2 .sdk/Applications/MobileSafari.app
        - N/A
        /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.2 .sdk/Applications/MobileSlideShow.app
        - N/A
        /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.2 .sdk/Applications/Preferences.app
        - N/A
        /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.2 .sdk/Applications/Web.app
        - N/A
        /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.2 .sdk/System/Library/CoreServices/MobileStorageMounter.app
        - N/A
        /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.2 .sdk/System/Library/CoreServices/SpringBoard.app
        - N/A
        /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.2 .sdk/System/Library/CoreServices/VoiceOverTouch.app
        - N/A
        /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.0 .sdk/Applications/AdSheet.app
        - N/A
        /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.0 .sdk/Applications/Contacts.app
        - N/A
        /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.0 .sdk/Applications/Game Center.app
        - N/A
        /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.0 .sdk/Applications/MobileSafari.app
        - N/A
        /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.0 .sdk/Applications/MobileSlideShow.app
        - N/A
        /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.0 .sdk/Applications/Preferences.app
        - N/A
        /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.0 .sdk/Applications/TrustMe.app
        - N/A
        /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.0 .sdk/Applications/Web.app
        - N/A
        /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.0 .sdk/Applications/WebSheet.app
        - N/A
        /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.0 .sdk/Applications/iPodOut.app
        - N/A
        /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.0 .sdk/System/Library/CoreServices/MobileStorageMounter.app
        - N/A
        /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.0 .sdk/System/Library/CoreServices/SpringBoard.app
        - N/A
        /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.0 .sdk/System/Library/CoreServices/VoiceOverTouch.app
        - N/A
        /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.1 .sdk/Applications/AdSheet.app
        - N/A
        /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.1 .sdk/Applications/Contacts.app
        - N/A
        /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.1 .sdk/Applications/Game Center~iphone.app
        - N/A
        /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.1 .sdk/Applications/MobileSafari.app
        - N/A
        /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.1 .sdk/Applications/MobileSlideShow.app
        - N/A
        /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.1 .sdk/Applications/Preferences.app
        - N/A
        /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.1 .sdk/Applications/TrustMe.app
        - N/A
        /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.1 .sdk/Applications/Web.app
        - N/A
        /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.1 .sdk/Applications/WebSheet.app
        - N/A
        /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.1 .sdk/Applications/iPodOut.app
        - N/A
        /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.1 .sdk/System/Library/CoreServices/MobileStorageMounter.app
        - N/A
        /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.1 .sdk/System/Library/CoreServices/SpringBoard.app
        - N/A
        /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.1 .sdk/System/Library/CoreServices/VoiceOverTouch.app
        - N/A
        /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.2 .sdk/Applications/AdSheet.app
        - N/A
        /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.2 .sdk/Applications/AdSheet~ipad.app
        - N/A
        /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.2 .sdk/Applications/Camera.app
        - N/A
        /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.2 .sdk/Applications/Contacts~ipad.app
        - N/A
        /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.2 .sdk/Applications/Contacts~iphone.app
        - N/A
        /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.2 .sdk/Applications/DataActivation.app
        - N/A
        /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.2 .sdk/Applications/Game Center~ipad.app
        - N/A
        /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.2 .sdk/Applications/Game Center~iphone.app
        - N/A
        /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.2 .sdk/Applications/MobileSafari.app
        - N/A
        /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.2 .sdk/Applications/MobileSlideShow.app
        - N/A
        /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.2 .sdk/Applications/Preferences.app
        - N/A
        /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.2 .sdk/Applications/TrustMe.app
        - N/A
        /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.2 .sdk/Applications/Web.app
        - N/A
        /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.2 .sdk/Applications/WebSheet.app
        - N/A
        /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.2 .sdk/Applications/iPodOut.app
        - N/A
        /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.2 .sdk/System/Library/CoreServices/MobileStorageMounter.app
        - N/A
        /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.2 .sdk/System/Library/CoreServices/SpringBoard.app
        - N/A
        /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.2 .sdk/System/Library/CoreServices/VoiceOverTouch.app
        - N/A
        /Library/Application Support/Adobe/Adobe Asset Services CS3/AssetServicesCS3.app
        - com.adobe.assetServicesCS3
        /Library/Application Support/Adobe/Adobe Version Cue CS3/Server/bin/VersionCueCS3.app
        - com.adobe.versioncueCS3.VersionCueCS3
        /Library/Application Support/Adobe/Adobe Version Cue CS3/Server/bin/VersionCueCS3Status.app
        - com.adobe.versioncueCS3.VCStatusMenu
        /Library/Application Support/Adobe/Installers/UUID/Setup.app
        - com.adobe.Installers.Redirector
        /Library/Application Support/Adobe/Installers/R1/Setup.app
        - com.adobe.Installers.Setup
        /Library/Application Support/Intuit/QuickBooks/2007/JHandShake.app
        - com.intuit.JHandShake
        /Library/Application Support/Microsoft/Silverlight/OutOfBrowser/SLLauncher.app
        - com.microsoft.silverlight.sllauncher
        /Library/Application Support/ProApps/MIO/RAD/Plugins/ReadMe(Image Handling Library).app
        - jp.co.canon.DocumentLauncher
        /Library/Application Support/iWork '08/iWork Tour.app
        - com.apple.iWorkTour
        /Library/Documentation/User Guides And Information.localized/Apple Hardware Test Read Me.app
        - com.apple.AppleHardwareTestReadMe
        /Library/Printers/EPSON/InkjetPrinter/AutoSetupTool/EPIJAutoSetupTool.app
        - com.epson.ijprinter.EPIJAutoSetupTool
        /Library/Printers/EPSON/InkjetPrinter/Filter/rastertoescp.app
        - com.epson.ijprinter.rastertoescp
        /Library/Printers/EPSON/InkjetPrinter/Utilities/EPSON Printer Utility3.app
        - com.epson.ijprinter.Utility3
        /Library/Printers/hp/Fax/fax.backend
        - com.hp.fax
        /Library/Printers/hp/Fax/rastertofax.filter
        - com.hp.rastertofax
        /Library/Printers/hp/cups/filters/pdftopdf.filter
        - com.hp.print.cups.filter.pdftopdf
        /Users/USER/Documents/iPhone Apps/Archivers/build/Debug-iphonesimulator/Archivers.app
        - N/A
        /Users/USER/Documents/iPhone Apps/Archivers_test/build/Debug-iphonesimulator/Archivers.app
        - N/A
        /Users/USER/Documents/iPhone Apps/DateCell/build/Debug-iphonesimulator/DateCell.app
        - N/A
        /Users/USER/Documents/iPhone Apps/EasyCustomTable/build/Debug-iphonesimulator/EasyCustomTable.app
        - N/A
        /Users/USER/Documents/iPhone Apps/Grids/build/Debug-iphonesimulator/Grids.app
        - N/A
        /Users/USER/Documents/iPhone Apps/Metalsmith Suite/build/Debug-iphoneos/Metalsmith Suite.app
        - N/A
        /Users/USER/Documents/iPhone Apps/Metalsmith Suite/build/Debug-iphonesimulator/Metalsmith Suite.app
        - N/A
        /Users/USER/Documents/iPhone Apps/Metalsmith Suite/build/Debug/Metalsmith Suite.app
        - com.yourcompany.Metalsmith-Suite
        /Users/USER/Documents/iPhone Apps/Metalsmith Suite/build/Distrobution-iphoneos/Metalsmith Suite.app
        - N/A
        /Users/USER/Documents/iPhone Apps/Scrolling/build/Debug-iphonesimulator/Scrolling.app
        - N/A
        /Users/USER/Documents/iPhone Apps/UICatalog/build/Debug-iphonesimulator/UICatalog.app
        - N/A
        /Users/USER/Documents/iPhone Apps/WebViewTutorial/build/Debug-iphonesimulator/WebViewTutorial.app
        - N/A
        /Users/USER/Documents/iPhone Apps/XML/build/Debug-iphonesimulator/XML.app
        - N/A
        /Users/USER/Documents/sites/nvrslp.com/dev/the_lab/ns_resize
        - N/A
        /Users/USER/Documents/sites/zoomify/Zoomifyer EZ v3.1/Zoomifyer EZ.app
        - N/A
        /Users/USER/Library/Application Support/Google/Chrome/Default/Web Applications/_crx_apdfllckaahabafndbhieahigkjlhalf/Default apdfllckaahabafndbhieahigkjlhalf.app
        - com.google.Chrome.app.Default-apdfllckaahabafndbhieahigkjlhalf-internal
        /Users/USER/Library/Application Support/Google/Chrome/Default/Web Applications/_crx_bepbmhgboaologfdajaanbcjmnhjmhfn/Default bepbmhgboaologfdajaanbcjmnhjmhfn.app
        - com.google.Chrome.app.Default-bepbmhgboaologfdajaanbcjmnhjmhfn-internal
        /Users/USER/Library/Application Support/Google/Chrome/Default/Web Applications/_crx_blpebaehgfgkcmmjjknibibbjacnplim/Default blpebaehgfgkcmmjjknibibbjacnplim.app
        - com.google.Chrome.app.Default-blpebaehgfgkcmmjjknibibbjacnplim-internal
        /Users/USER/Library/Application Support/iPhone Simulator/3.1.2/Applications/UUID/Metalsmith Suite.app
        - N/A
        /Users/USER/Library/Application Support/iPhone Simulator/3.1.3/Applications/UUID/Metalsmith Suite.app
        - N/A
        /Users/USER/Library/Application Support/iPhone Simulator/3.1.3/Applications/UUID/Metalsmith Suite.app
        - N/A
        /Users/USER/Library/Application Support/iPhone Simulator/3.1.3/Applications/UUID/UICatalog.app
        - N/A
        /Users/USER/Library/Application Support/iPhone Simulator/3.1.3/Applications/UUID/WebViewTutorial.app
        - N/A
        /Users/USER/Library/Application Support/iPhone Simulator/3.1.3/Applications/UUID/Archivers.app
        - N/A
        /Users/USER/Library/Application Support/iPhone Simulator/3.1.3/Applications/UUID/AnimatedGifExample.app
        - N/A
        /Users/USER/Library/Application Support/iPhone Simulator/3.2/Applications/UUID/Metalsmith Suite.app
        - N/A
        /Users/USER/Library/Application Support/iPhone Simulator/4.2/Applications/UUID/Spinspiration.app
        - N/A
        /Users/USER/Library/Application Support/iPhone Simulator/User/Applications/UUID/Metalsmith Suite.app
        - N/A
        /Users/USER/Library/Application Support/iPhone Simulator/User/Applications/UUID/XML.app
        - N/A
        /Users/USER/Library/Application Support/iPhone Simulator/User/Applications/UUID/DateCell.app
        - N/A
        /Users/USER/Library/Application Support/iPhone Simulator/User/Applications/UUID/UICatalog.app
        - N/A
        /Users/USER/Library/Application Support/iPhone Simulator/User/Applications/UUID/Metalsmith Suite.app
        - N/A
        /Users/USER/Library/Application Support/iPhone Simulator/User/Applications/UUID/Scrolling.app
        - N/A
        /Users/USER/Library/Application Support/iPhone Simulator/User/Applications/UUID/Autoscroll.app
        - N/A
        /Users/USER/Library/Application Support/iPhone Simulator/User/Applications/UUID/Grids.app
        - N/A
        /Users/USER/Library/Application Support/iPhone Simulator/User/Applications/UUID/TapToZoom.app
        - N/A
        /Users/USER/Library/Application Support/iPhone Simulator/User/Applications/UUID/EasyCustomTable.app
        - N/A
        /Users/USER/Library/Preferences/Macromedia/Flash Player/www.macromedia.com/bin/octoshape/octoshape
        - N/A
    Frameworks
        /Library/Frameworks/REDCODE.Color.framework
        - com.red.redcode.color
        /Users/USER/Library/Frameworks/EWSMac-GC.framework
        - com.eSellerate.EWSMac67108872
    PrefPane
        /Library/PreferencePanes/Flash Player.prefPane
        - com.adobe.flashplayerpreferences
        /Library/PreferencePanes/REDcode.prefPane
        - com.red.prefpanel
        /Library/PreferencePanes/VersionCueCS3.prefPane
        - com.adobe.versioncueCS3.VCPrefPane
        /Users/USER/Library/PreferencePanes/Growl.prefPane
        - com.growl.prefpanel
    Bundles
        /Library/Application Support/Adobe/Adobe Asset Services CS3/Plug-Ins/ASEFormat.plugin
        - com.adobe.aseformat
        /Library/Application Support/Adobe/Adobe Asset Services CS3/Plug-Ins/BMP.plugin
        - null
        /Library/Application Support/Adobe/Adobe Asset Services CS3/Plug-Ins/Cineon.plugin
        - null
        /Library/Application Support/Adobe/Adobe Asset Services CS3/Plug-Ins/EPS Parser.plugin
        - null
        /Library/Application Support/Adobe/Adobe Asset Services CS3/Plug-Ins/GIF.plugin
        - null
        /Library/Application Support/Adobe/Adobe Asset Services CS3/Plug-Ins/JPEG2000.plugin
        - null
        /Library/Application Support/Adobe/Adobe Asset Services CS3/Plug-Ins/OpenEXR.plugin
        - null
        /Library/Application Support/Adobe/Adobe Asset Services CS3/Plug-Ins/PBM.plugin
        - null
        /Library/Application Support/Adobe/Adobe Asset Services CS3/Plug-Ins/PCX.plugin
        - null
        /Library/Application Support/Adobe/Adobe Asset Services CS3/Plug-Ins/PNG.plugin
        - null
        /Library/Application Support/Adobe/Adobe Asset Services CS3/Plug-Ins/Pixar.plugin
        - null
        /Library/Application Support/Adobe/Adobe Asset Services CS3/Plug-Ins/Radiance.plugin
        - null
        /Library/Application Support/Adobe/Adobe Asset Services CS3/Plug-Ins/Targa.plugin
        - null
        /Library/Application Support/Adobe/Adobe Asset Services CS3/Plug-Ins/WBMP.plugin
        - null
        /Library/Application Support/Adobe/Adobe Asset Services CS3/Plug-Ins/altiveccore.plugin
        - null
        /Library/Application Support/Adobe/Adobe Asset Services CS3/Plug-Ins/dicom.plugin
        - com.adobe.dicom
        /Library/Application Support/Adobe/Adobe Asset Services CS3/Plug-Ins/mmxcore.plugin
        - null
        /Library/Application Support/Adobe/Adobe Asset Services CS3/Plug-Ins/multiprocessor support.plugin
        - null
        /Library/Application Support/Adobe/Adobe Asset Services CS3/Plug-Ins/ppccore.plugin
        - null
        /Library/Application Support/Adobe/Adobe Asset Services CS3/Required/Photoshop Adapter.plugin
        - null
        /Library/Application Support/Adobe/Flash Player/Flash Player.plugin
        - com.macromedia.Flash Player.plugin
        /Library/Application Support/Adobe/Plug-Ins/CS3/File Formats/Camera Raw.plugin
        - com.adobe.CameraRaw
        /Library/Frameworks/HPDeviceModel.framework/Versions/2.0/Frameworks/Core.framew ork/Versions/2.0/Resources/PlugIns/CFXmlParser.plugin
        - com.hp.dmf.plugins.CFXmlParser
        /Library/Frameworks/HPDeviceModel.framework/Versions/2.0/Frameworks/Core.framew ork/

  • Need help with calculator project for an assignment...

    Hi all, I please need help with my calculator project that I have to do for an assignment.
    Here is the project's specifications that I need to do"
    """Create a console calculator applicaion that:
    * Takes one command line argument: your name and surname. When the
    program starts, display the date and time with a welcome message for the
    user.
    * Display all the available options to the user. Your calculator must include
    the arithmetic operations as well as at least five scientific operations of the
    Math class.
    -Your program must also have the ability to round a number and
    truncate it.
    -When you multiply by 2, you should not use the '*' operator to perform the
    operation.
    -Your program must also be able to reverse the sign of a number.
    * Include sufficient error checking in your program to ensure that the user
    only enters valid input. Make use of the String; Character, and other
    wrapper classes to help you.
    * Your program must be able to do conversions between decimal, octal and
    hex numbers.
    * Make use of a menu. You should give the user the option to end the
    program when entering a certain option.
    * When the program exits, display a message for the user, stating the
    current time, and calculate and display how long the user used your
    program.
    * Make use of helper classes where possible.
    * Use the SDK to run your program."""
    When the program starts, it asks the user for his/her name and surname. I got the program to ask the user again and again for his/her name and surname
    when he/she doesn't insert anything or just press 'enter', but if the user enters a number for the name and surname part, the program continues.
    Now my question is this: How can I restrict the user to only enter 'letters' (and spaces of course) but allow NO numbers for his/her surname??
    Here is the programs code that I've written so far:
    {code}
    import java.io.*;
    import java.util.*;
    import java.text.*;
    public class Project {
         private static String nameSurname = "";     
         private static String num1 = null;
         private static String num2 = null;
         private static String choice1 = null;
         private static double answer = 0;
         private static String more;
         public double Add() {
              answer = (Double.parseDouble(num1) + Double.parseDouble(num2));
              return answer;
         public double Subtract() {
              answer = (Double.parseDouble(num1) - Double.parseDouble(num2));
              return answer;
         public double Multiply() {
              answer = (Double.parseDouble(num1) * Double.parseDouble(num2));
              return answer;
         public double Divide() {
              answer = (Double.parseDouble(num1) / Double.parseDouble(num2));
              return answer;
         public double Modulus() {
              answer = (Double.parseDouble(num1) % Double.parseDouble(num2));
              return answer;
         public double maximumValue() {
              answer = (Math.max(Double.parseDouble(num1), Double.parseDouble(num2)));
              return answer;
         public double minimumValue() {
              answer = (Math.min(Double.parseDouble(num1), Double.parseDouble(num2)));
              return answer;
         public double absoluteNumber1() {
              answer = (Math.abs(Double.parseDouble(num1)));
              return answer;
         public double absoluteNumber2() {
              answer = (Math.abs(Double.parseDouble(num2)));
              return answer;
         public double Squareroot1() {
              answer = (Math.sqrt(Double.parseDouble(num1)));
              return answer;
         public double Squareroot2() {
              answer = (Math.sqrt(Double.parseDouble(num2)));
              return answer;
         public static String octalEquivalent1() {
              int iNum1 = Integer.parseInt(num1);
    String octal1 = Integer.toOctalString(iNum1);
    return octal1;
         public static String octalEquivalent2() {
              int iNum2 = Integer.parseInt(num2);
              String octal2 = Integer.toOctalString(iNum2);
              return octal2;
         public static String hexadecimalEquivalent1() {
              int iNum1 = Integer.parseInt(num1);
              String hex1 = Integer.toHexString(iNum1);
              return hex1;
         public static String hexadecimalEquivalent2() {
              int iNum2 = Integer.parseInt(num2);
              String hex2 = Integer.toHexString(iNum2);
              return hex2;
         public double Round1() {
              answer = Math.round(Double.parseDouble(num1));
              return answer;
         public double Round2() {
              answer = Math.round(Double.parseDouble(num2));
              return answer;
              SimpleDateFormat format1 = new SimpleDateFormat("EEEE, dd MMMM yyyy");
         Date now = new Date();
         SimpleDateFormat format2 = new SimpleDateFormat("hh:mm a");
         static Date timeIn = new Date();
         public static long programRuntime() {
              Date timeInD = timeIn;
              long timeOutD = System.currentTimeMillis();
              long msec = timeOutD - timeInD.getTime();
              float timeHours = msec / 1000;
                   return (long) timeHours;
         DecimalFormat decimals = new DecimalFormat("#0.00");
         public String insertNameAndSurname() throws IOException{
              boolean inputCorrect = false;
                   while (inputCorrect == false) {
                        while (nameSurname == null || nameSurname.length() == 0) {
                             for (int i = 0; i < nameSurname.length(); i++) {
                             if ((nameSurname.charAt(i) > 'a') && (nameSurname.charAt(i) < 'Z')){
                                       inputCorrect = true;
                        else{
                        inputCorrect = false;
                        break;
                        try {
                             BufferedReader inStream = new BufferedReader (new InputStreamReader(System.in));
                             System.out.print("Please enter your name and surname: ");
                             nameSurname = inStream.readLine();
                             inputCorrect = true;
                        }catch (IOException ex) {
                             System.out.println("You did not enter your name and surname, " + nameSurname + " is not a name, please enter your name and surname :");
                             inputCorrect = false;
                        System.out.println("\nA warm welcome " + nameSurname + " ,todays date is: " + format1.format(now));
                        System.out.println("and the time is now exactly " + format2.format(timeIn) + ".");
                        return nameSurname;
              public String inputNumber1() throws IOException {
              boolean inputCorrect = false;
                   while (inputCorrect == false) {
                        try {
                             BufferedReader br = new BufferedReader (new InputStreamReader(System.in));
                             System.out.print("\nPlease enter a number you want to do a calculation with and hit <ENTER>: ");
                             num1 = br.readLine();
                             double number1 = Double.parseDouble(num1);
                             System.out.println("\nThe number you have entered is: " + number1);
                             inputCorrect = true;
                        } catch (NumberFormatException nfe) {
                             System.out.println("\nYou did not enter a valid number: " + "\""+ num1 + "\" is not a number!!");
                             inputCorrect = false;
                        return num1;
         public String calculatorChoice() throws IOException {
              System.out.println("Please select an option of what you would like to do with this number from the menu below and hit <ENTER>: ");
              System.out.println("\n*********************************************");
              System.out.println("---------------------------------------------");
              System.out.println("Please select an option from the list below: ");
              System.out.println("---------------------------------------------");
              System.out.println("1 - Add");
              System.out.println("2 - Subtract");
              System.out.println("3 - Multiply");
              System.out.println("4 - Divide (remainder included)");
              System.out.println("5 - Maximum and minimum value of two numbers");
              System.out.println("6 - Squareroot");
              System.out.println("7 - Absolute value of numbers");
              System.out.println("8 - Octal and Hexadecimal equivalent of numbers");
              System.out.println("9 - Round numbers");
              System.out.println("0 - Exit program");
              System.out.println("**********************************************");
              boolean inputCorrect = false;
                   while (inputCorrect == false) {
                        try {
                             BufferedReader inStream = new BufferedReader (new InputStreamReader(System.in));
                             System.out.print("Please enter your option and hit <ENTER>: ");
                             choice1 = inStream.readLine();
                             int c1 = Integer.parseInt(choice1);
                             System.out.println("\nYou have entered choice number: " + c1);
                             inputCorrect = true;
                        } catch (NumberFormatException nfe) {
                             System.out.println("You did not enter a valid choice number: " + "\""+ choice1 + "\" is not in the list!!");
                             inputCorrect = false;
                        return choice1;
         public String inputNumber2() throws IOException {
              boolean inputCorrect = false;
                   while (inputCorrect == false) {
                        try {
                             BufferedReader br2 = new BufferedReader (new InputStreamReader(System.in));
                             System.out.print("\nPlease enter another number you want to do the calculation with and hit <ENTER>: ");
                             num2 = br2.readLine();
                             double n2 = Double.parseDouble(num2);
                             System.out.println("\nThe second number you have entered is: " + n2);
                             System.out.println("\nYour numbers are: " + num1 + " and " + num2);
                             inputCorrect = true;
                        } catch (NumberFormatException nfe) {
                             System.out.println("You did not enter a valid number: " + "\""+ num2 + "\" is not a number!!");
                             inputCorrect = false;
                        return num2;
         public int Calculator() {
              int choice2 = (int) Double.parseDouble(choice1);
              switch (choice2) {
                        case 1 :
                             Add();
                             System.out.print("The answer of " + num1 + " + " + num2 + " is: " + decimals.format(answer));
                             break;
                        case 2 :
                             Subtract();
                             System.out.print("The answer of " + num1 + " - " + num2 + " is: " + decimals.format(answer));
                             break;
                        case 3 :
                             Multiply();
                             System.out.print("The answer of " + num1 + " * " + num2 + " is: " + decimals.format(answer));
                             break;
                        case 4 :
                             Divide();
                             System.out.print("The answer of " + num1 + " / " + num2 + " is: " + decimals.format(answer));
                             Modulus();
                             System.out.print(" and the remainder is " + decimals.format(answer));
                             break;
                        case 5 :
                             maximumValue();
                             System.out.println("The maximum number between the numbers " + num1 + " and " + num2 + " is: " + decimals.format(answer));
                             minimumValue();
                             System.out.println("The minimum number between the numbers " + num1 + " and " + num2 + " is: " + decimals.format(answer));
                             break;
                        case 6 :
                             Squareroot1();
                             System.out.println("The squareroot of value " + num1 + " is: " + decimals.format(answer));
                             Squareroot2();
                             System.out.println("The squareroot of value " + num2 + " is: " + decimals.format(answer));
                             break;
                        case 7 :
                             absoluteNumber1();
                             System.out.println("The absolute number of " + num1 + " is: " + decimals.format(answer));
                             absoluteNumber2();
                             System.out.println("The absolute number of " + num2 + " is: " + decimals.format(answer));
                             break;
                        case 8 :
                             octalEquivalent1();
                             System.out.println("The octal equivalent of " + num1 + " is: " + octalEquivalent1());
                             octalEquivalent2();
                             System.out.println("The octal equivalent of " + num2 + " is: " + octalEquivalent2());
                             hexadecimalEquivalent1();
                             System.out.println("\nThe hexadecimal equivalent of " + num1 + " is: " + hexadecimalEquivalent1());
                             hexadecimalEquivalent2();
                             System.out.println("The hexadecimal equivalent of " + num2 + " is: " + hexadecimalEquivalent2());
                             break;
                        case 9 :
                             Round1();
                             System.out.println("The rounded number of " + num1 + " is: " + decimals.format(answer));
                             Round2();
                             System.out.println("The rounded number of " + num2 + " is: " + decimals.format(answer));
                             break;
                        case 0 :
                             if (choice2 == 0) {
                                  System.exit(1);
                             break;
                   return choice2;
              public String anotherCalculation() throws IOException {
                   boolean inputCorrect = false;
                   while (inputCorrect == false) {
                             try {                              
                                  BufferedReader br3 = new BufferedReader (new InputStreamReader(System.in));
                                  System.out.print("\nWould you like to do another calculation? Y/N ");
                                  more = br3.readLine();
                                  String s1 = "y";
                                  String s2 = "Y";
                                  if (more.equals(s1) || more.equals(s2)) {
                                       inputCorrect = true;
                                       while (inputCorrect = true){
                                            inputNumber1();
                                            System.out.println("");
                                            calculatorChoice();
                                            System.out.println("");
                                            inputNumber2();
                                            System.out.println("");
                                            Calculator();
                                            System.out.println("");
                                            anotherCalculation();
                                            System.out.println("");
                                            inputCorrect = true;
                                  } else {
                                       System.out.println("\n" + nameSurname + " thank you for using this program, you have used this program for: " + decimals.format(programRuntime()) + " seconds");
                                       System.out.println("the program will now exit, Goodbye.");
                                       System.exit(0);
                             } catch (IOException ex){
                                  System.out.println("You did not enter a valid answer: " + "\""+ more + "\" is not in the list!!");
                                  inputCorrect = false;
              return more;
         public static void main(String[] args) throws IOException {
              Project p1 = new Project();
              p1.insertNameAndSurname();
              System.out.println("");
              p1.inputNumber1();
              System.out.println("");
              p1.calculatorChoice();
              System.out.println("");
              p1.inputNumber2();
              System.out.println("");
              p1.Calculator();
                   System.out.println("");
                   p1.anotherCalculation();
                   System.out.println("");
    {code}
    *Can you please run my code for yourself and have a look at how this program is constructed*
    *and give me ANY feedback on how I can better this code(program) or if I've done anything wrong from your point of view.*
    Your help will be much appreciated.
    Thanks in advance

    Smirre wrote:
    Now my question is this: How can I restrict the user to only enter 'letters' (and spaces of course) but allow NO numbers for his/her surname??You cannot restrict the user. It is a sad fact in programming that the worst bug always sits in front of the Computer.
    What you could do is checking the input string for numbers. If it contains numbers, just reprompt for the Name.
    AND you might want to ask yourself why the heck a calculator needs to know the users Name.

  • Need help with my usecase based on transient ViewObject

    I am using 11.1.1.4.0 Jdev version. I need help with my usecase.Been trying it for 2 days but couldn't figure out the issue.
    I have a transientVO . In this VO Rows will be populated programmatically. CountryId is an attribute of this VO. I have created a viewAccessor "CountriesVA" from Country VO of HR schema.
    I have a LOV for the countryId which is based on this VA ,getting countries from CountryTable.
    This is the model part which works fine.
    Before the page load i have called  a method to create a row for this transientVO.Once the row is created i can see the SOC in my page which i have created as below.
    Now i want to insert a row in the transientVO if user selects a country and restrict duplicate entry . (As One row is already created 1st time there will be no rows created.after that rows will be inserted)
    The issue is :: Suppose there are 2 countries. A & B .When user does the following actions :
    Insert A . Done //as 1st entry
    Insert B . Done //as 1st time entry
    Insert A . duplicate not inserted
    Insert B . getting inserted // the bug.
    <af:selectOneChoice value="#{bindings.CountryId.inputValue}"
                            label="#{bindings.CountryId.label}"
                            required="#{bindings.CountryId.hints.mandatory}"
                            shortDesc="#{bindings.CountryId.hints.tooltip}" id="soc1"
                            immediate="true" autoSubmit="true"
                            valueChangeListener="#{pageFlowScope.managedBean.countryIdVC}">
        public void countryIdVC(ValueChangeEvent valueChangeEvent) {
            // Add event code here...
            String oldValue=null;
              setEL("#{bindings.CountryId.inputValue}", valueChangeEvent.getOldValue());
              if(evaluateEL("#{bindings.CountryId.attributeValue}")!=null)
             oldValue =evaluateEL("#{bindings.CountryId.attributeValue}").toString();
                    setEL("#{bindings.CountryId.inputValue}", valueChangeEvent.getNewValue());
            String newValue=evaluateEL("#{bindings.CountryId.attributeValue}").toString();
            BindingContainer bindings = BindingContext.getCurrent().getCurrentBindingsEntry();
             DCIteratorBinding dciter = (DCIteratorBinding) bindings.get("ViewObj1Iterator");
             //access the underlying RowSetIterator
             RowSetIterator rsi = dciter.getRowSetIterator();
          boolean duplicate=true;
          if(oldValue!=null){
                    rsi.getCurrentRow().setAttribute("CountryId", oldValue);
        //  Row row= rsi.findByKey(new Key(new Object[] { newValue}), 1)[0];
          Key key =new Key(new Object[] { newValue});
          Row row=rsi.getRow(key);
          if(row==null){
          System.err.println(duplicate);
            duplicate=false;
          }else{
            rsi.setCurrentRow(row);
             if(!duplicate){
             //get handle to the last row
             Row lastRow = rsi.last();
             //obtain the index of the last row
             int lastRowIndex = rsi.getRangeIndexOf(lastRow);
             //create a new row
             Row newRow = rsi.createRow();
             newRow.setAttribute("CountryId", newValue);
             //initialize the row
             newRow.setNewRowState(Row.STATUS_INITIALIZED);
             //add row to last index + 1 so it becomes last in the range set
             rsi.insertRowAtRangeIndex(lastRowIndex +1, newRow);
             //make row the current row so it is displayed correctly
             rsi.setCurrentRow(newRow);

    I read the reply from Andrejus Baranovskis and thought of studying and implementing that in my useCase.Well it worked . I implemented the same Logic but rowIteration was done in AppModule.
    Con-Fusion, Bugs, Facts &amp;amp; Workarounds: Iterating through View Object RowIterator Bug.(NOT ADF BUG, Development B…
    http://docs.oracle.com/cd/E15523_01/web.1111/b31974/bcservices.htm#sm0206
    9.7.6 What You May Need to Know About Programmatic Row Set Iteration
    The problem is solved ,the above links helped me solve the problem.
    what i did is i have created a method in appmodule to iterate rows and all the method y operation bindings and my logic works fine ....
    MY Advice to all Adf developers ,though i am not an expert but i can assure you to follow the above process for rowIteration.If you use the  iterator binding in the manage bean to navigate the rows u'll face issues which are unexpected.
    In AppModule :::::
        public boolean createRow(String oldValue,String newValue){
         System.err.println(oldValue+""+newValue);
          ViewObjectImpl vo=getViewObj1();
          boolean duplicate=false;
          if(oldValue!=null){
          RowSetIterator iter = vo.createRowSetIterator(null);
          System.err.println("iterating rows ");
             while (iter.hasNext()) {
                 Row r = iter.next();
                 System.err.println(iter.getRangeIndexOf(r)+" row is "+r.getAttribute("CountryId"));
                 if(r.getAttribute("CountryId").toString().equals(newValue)){
                     duplicate=true;
                     break;
                 // Do something with the current row.
             // close secondary row set iterator
             iter.closeRowSetIterator();
          return duplicate;
    In ManageBean :::::
        public void countryIdVC(ValueChangeEvent valueChangeEvent) {
            // Add event code here...
            String oldValue=null;
           System.err.println("Old Value"+valueChangeEvent.getOldValue());
              setEL("#{bindings.CountryId.inputValue}", valueChangeEvent.getOldValue());
              if(evaluateEL("#{bindings.CountryId.attributeValue}")!=null)
             oldValue =evaluateEL("#{bindings.CountryId.attributeValue}").toString();
                    setEL("#{bindings.CountryId.inputValue}", valueChangeEvent.getNewValue());
            String newValue=evaluateEL("#{bindings.CountryId.attributeValue}").toString();
            BindingContainer bindings = BindingContext.getCurrent().getCurrentBindingsEntry();
             //access the name of the iterator the table is bound to. Its "allDepartmentsIterator"
             //in this sample
             DCIteratorBinding dciter = (DCIteratorBinding) bindings.get("ViewObj1Iterator");
             //access the underlying RowSetIterator
             RowSetIterator rsi = dciter.getRowSetIterator();
             if(oldValue!=null){
                          rsi.getCurrentRow().setAttribute("CountryId", oldValue);
               OperationBinding operation = bindings.getOperationBinding("createRow");
               operation.getParamsMap().put("oldValue", oldValue);
               operation.getParamsMap().put("newValue", newValue);
          if(!(Boolean)operation.execute()){
          //get handle to the last row
          Row lastRow = rsi.last();
          //obtain the index of the last row
          int lastRowIndex = rsi.getRangeIndexOf(lastRow);
          //create a new row
          Row newRow = rsi.createRow();
          newRow.setAttribute("CountryId", newValue);
          //initialize the row
          newRow.setNewRowState(Row.STATUS_INITIALIZED);
          //add row to last index + 1 so it becomes last in the range set
          System.err.println("Inserting row at index "+lastRowIndex+1);
          rsi.insertRowAtRangeIndex(lastRowIndex +1, newRow);
          //make row the current row so it is displayed correctly
          rsi.setCurrentRow(newRow);
          else{
            System.err.println("Data found So not inserting,only setting current Row");
          Key key =new Key(new Object[] { newValue});
            rsi.setCurrentRow(rsi.getRow(key));

  • Need help with a recordset

    I need some help with a recordset that selects a series of
    vehicle makes that then show models when a make is selected. The
    problem is when I select the make it shows a list of models like it
    should, some of the make lists have five models and some have ten
    or more. What I need help with is how to limit the list to just the
    models and not include the "null" values. This makes my drop down
    list have large empty spaces at the end of the options listed. The
    query is as follows:
    SELECT *
    FROM saa.vehicle_make
    WHERE make = '#FORM.select_make#'
    Question # 2:
    What can I add to this recordset so that I can search on just
    the make alone without the model included. The submit includes both
    of the make and model lists so that makes it tough to break up.
    Here is the recordset:
    SELECT make
    FROM saa.vehicle_make
    ORDER BY make ASC
    Thanks
    Shane

    Sorry I guess I wasn't being clear. The lists work fine with
    the present recordsets but I was trying to clean them up just a
    little. I am using a table in mysql instead of an array for ease of
    maintenance due to the high number of makes and models I am working
    with.
    For question number one I was looking for sql that allows me
    to only show the models in the table for each make no matter how
    many are in the row. Currently when I use the existing recordset I
    get a long list of blank spaces as it is returning the "null"
    fields also. I would like it to just show the models and stop at
    the first null field.
    For the second question I wanted to be able to submit the
    form with just the make listed if someone wanted to see all Hondas
    lets say. Not I have to select the make also so it limits the
    return.
    Thanks for all of the input
    Shane
    Here is the code I am using for the two dependent select
    boxes:
    <p align="center">Vehicle Search by
    Make/Model</p>
    <!--- store the selected make variable after the first
    select boxes submits itself --->
    <cfif isDefined('form.select_make')>
    <cfset page.select_make = form.select_make>
    </cfif>
    <cfoutput>
    <form name="DropDown" method="post">
    <!--- query DB for the first drop down list --->
    <cfquery name="get_make" datasource="saa">
    SELECT make FROM saa.vehicle_make ORDER BY make ASC
    </cfquery>
    <!--- first drop down list --->
    <!--- NOTICE the onChange javascript event in the select
    tag, this is what submits the form after the first selection
    --->
    <p align="center">Model:<select name="select_make"
    required="yes" onchange="this.form.submit()">
    <option>Select Make</option>
    <!--- dynamically populate the first drop down list based
    on the get_make query --->
    <cfloop query="get_make">
    <option value="#make#" <cfif
    isDefined('form.select_make')><cfif form.select_make eq
    "#make#">selected</cfif></cfif>>#make#</option>
    </cfloop>
    </select></p>
    <!--- if the first selection has been made, display the
    second drop down list with the appropriate results --->
    <cfif isDefined('form.select_make')>
    <!--- query DB for second drop down list, based on the
    selected item from the first list --->
    <cfquery name="get_model" datasource="saa">
    SELECT * FROM saa.vehicle_make WHERE make =
    '#FORM.select_make#'
    </cfquery>
    <!--- second drop down list --->
    </cfif>
    </form>
    </cfoutput>
    <cfoutput>
    <form action="buyerModelSearchresults.cfm"
    method="POST">
    <p align="center">Model: <select name="model"
    required="yes">
    <option>Select Model</option>
    <!--- dynamically populate the second drop down list
    based on the get_make query --->
    <cfloop query="get_model">
    <option value="#model1#">#model1#</option>
    <option value="#model2#">#model2#</option>
    <option value="#model3#">#model3#</option>
    <option value="#model4#">#model4#</option>
    <option value="#model5#">#model5#</option>
    <option value="#model6#">#model6#</option>
    <option value="#model7#">#model7#</option>
    <option value="#model8#">#model8#</option>
    <option value="#model9#">#model9#</option>
    <option value="#model10#">#model10#</option>
    <option value="#model11#">#model11#</option>
    <option value="#model12#">#model12#</option>
    <option value="#model13#">#model13#</option>
    <option value="#model14#">#model14#</option>
    <option value="#model15#">#model15#</option>
    <option value="#model16#">#model16#</option>
    <option value="#model17#">#model17#</option>
    <option value="#model18#">#model18#</option>
    <option value="#model19#">#model19#</option>
    <option value="#model20#">#model20#</option>
    <option value="#model21#">#model21#</option>
    <option value="#model22#">#model22#</option>
    <option value="#model23#">#model23#</option>
    <option value="#model24#">#model24#</option>
    <option value="#model25#">#model25#</option>
    </cfloop>
    </select>
    </p>
    <p align="center">Search by Make/Model:</p>
    <p align="center"><input type="submit" name="Submit"
    value="Submit"></p>
    </form>
    </cfoutput>

  • Need help with threads?.. please check my approach!!

    Hello frnds,
    I am trying to write a program.. who monitors my external tool.. please check my way of doing it.. as whenever i write programs having thread.. i end up goosy.. :(
    first let me tell.. what I want from program.. I have to start an external tool.. on separate thread.. (as it takes some time).. then it takes some arguments(3 arguments).. from file.. so i read the file.. and have to run tool.. continously.. until there are arguments left.. in file.. or.. user has stopped it by pressing STOP button..
    I have to put a marker in file too.. so that.. if program started again.. file is read from marker postion.. !!
    Hope I make clear.. what am trying to do!!
    My approach is like..
    1. Have two buttons.. START and STOP on Frame..
    START--> pressed
    2. check marker("$" sign.. placed in beginning of file during start).. on file..
         read File from marker.. got 3 arg.. pass it to tool.. and run it.. (on separate thread).. put marker.. (for next reading)
         Step 2.. continously..
    3. STOP--> pressed
         until last thread.. stops.. keep running the tool.. and when last thread stops.. stop reading any more arguments..
    Question is:
    1. Should i read file again and again.. ?.. or read it once after "$" sign.. store data in array.. and once stopped pressed.. read file again.. and put marker ("$" sign) at last read line..
    2. how should i know when my thread has stopped.. so I start tool again??.. am totally confused.. !!
    please modify my approach.. if u find anything odd..
    Thanks a lot in advance
    gervini

    Hello,
    I have no experience with threads or with having more than run "program" in a single java file. All my java files have the same structure. This master.java looks something like this:
    ---master.java---------------------------------------------------
    import java.sql.*;
    import...
    public class Master {
    public static void main(String args []) throws SQLException, IOException {
    //create connection pool here
    while (true) { // start loop here (each loop takes about five minutes)
    // set values of variables
    // select a slave process to run (from a list of slave programs)
    execute selected slave program
    // check for loop exit value
    } // end while loop
    System.out.println("Program Complete");
    } catch (Exception e) {
    System.out.println("Error: " + e);
    } finally {
    if (rSet1 != null)
    try { rSet1.close(); } catch( SQLException ignore ) { /* ignored */ }
    connection.close();
    -------end master.java--------------------------------------------------------
    This master.java program will run continuously for days or weeks, each time through the loop starting another slave process which runs for five minutes to up to an hour, which means there may be ten to twenty of these slave processes running simultaneously.
    I believe threads is the best way to do this, but I don't know where to locate these slave programs: either inside the master.java program or separate slave.java files? I will need help with either method.
    Your help is greatly appreciated. Thank you.
    Logan

  • Need help with Pivoting rows to columns

    Hi,
    I need help with pivoting rows to columns. I know there are other posts regarding this, but my requirement is more complex and harder. So, please give me a solution for this.
    There are two tables say Table 1 and Table 2.
    Table1
    name address email identifier
    x e g 1
    f s d 2
    h e n 3
    k l b 4
    Table2
    identifier TRno zno bzid
    1 T11 z11 b11
    1 T12 z12 b12
    1 T13 z13 b13
    2 T21 z21 b21
    2 T22 z22 b22
    As you can see the identifier is the column that we use to map the two tables. The output should be like below
    output
    name address email identifier TRno1 zno1 bzid1 TRno2 zno2 bzid2 TRno3 zno3 bzid3
    x e g 1 T11 z11 b11 T12 z12 b12 T13 z13 b13
    f s d 2 T21 z21 b21 t22 z22 b22
    Also we do not know exactly how many TRno's, zno's, etc each value in the identifier will have. There may be only 1 TRNO, zno and bzid, or there may be four.
    All the values must be in separate columns, and not be just comma delimitted. There are also other conditions that i have to add to restrict the data.
    So, can you please tell me what is should use to get the data in the required format? We are using Oracle 10g. Please let me know if u need any more information

    Something like this ?
    SCOTT@orcl> ed
    Wrote file afiedt.buf
      1  select a.name,
      2  a.address,
      3  a.email,
      4  b.* from (
      5  select distinct identifier
      6  ,max(trno1) trno1
      7  ,max(zno1) zno1
      8  ,max(bzid1) bzid1
      9  ,max(trno2) trno2
    10  ,max(zno2) zno2
    11  ,max(bzid2) bzid2
    12  ,max(trno3) trno3
    13  ,max(zno3) zno3
    14  ,max(bzid3) bzid3
    15  ,max(trno4) trno4
    16  ,max(zno4) zno4
    17  ,max(bzid4) bzid4
    18  from (select identifier
    19  ,decode(rn,1,trno,null) trno1
    20  ,decode(rn,1,zno,null) zno1
    21  ,decode(rn,1,bzid,null) bzid1
    22  ,decode(rn,2,trno,null) trno2
    23  ,decode(rn,2,zno,null) zno2
    24  ,decode(rn,2,bzid,null) bzid2
    25  ,decode(rn,3,trno,null) trno3
    26  ,decode(rn,3,zno,null) zno3
    27  ,decode(rn,3,bzid,null) bzid3
    28  ,decode(rn,4,trno,null) trno4
    29  ,decode(rn,4,zno,null) zno4
    30  ,decode(rn,4,bzid,null) bzid4
    31  from (select identifier,
    32  trno,bzid,zno,
    33  dense_rank() over(partition by identifier order by trno,rownum) rn
    34  from table2)
    35  order by identifier)
    36  group by identifier) b,table1 a
    37* where a.identifier=b.identifier
    SCOTT@orcl> /
    NAME       ADDRESS    EMAIL      IDENTIFIER TRNO1      ZNO1       BZID1      TRNO2      ZNO2       BZID2      TRNO3      ZNO3       BZID3      TRNO4      ZNO4       BZID4
    x          e          g          1          T11        z11        b11        T12        z12        b12        T13        z13        b13
    f          s          d          2          T21        z21        b21        T22        z22        b22
    SCOTT@orcl> select * from table1;
    NAME       ADDRESS    EMAIL      IDENTIFIER
    x          e          g          1
    f          s          d          2
    h          e          n          3
    k          l          b          4
    SCOTT@orcl> select * from table2;
    IDENTIFIER TRNO       ZNO        BZID
    1          T11        z11        b11
    1          T12        z12        b12
    1          T13        z13        b13
    2          T21        z21        b21
    2          T22        z22        b22
    SCOTT@orcl>Regards
    Girish Sharma

  • Need help with applet servlet communication .. not able to get OutputStream

    i am facing problem with applet and servlet communication. i need to send few image files from my applet to the servlet to save those images in DB.
    i need help with sending image data to my servlet.
    below is my sample program which i am trying.
    java source code which i am using in my applet ..
    public class Test {
        public static void main(String argv[]) {
            try {
                    URL serverURL = new URL("http://localhost:8084/uploadApp/TestServlet");
                    URLConnection connection = serverURL.openConnection();
                    Intermediate value=new Intermediate();
                    value.setUserId("user123");
                    connection.setDoInput(true);
                    connection.setDoOutput(true);
                    connection.setUseCaches(false);
                    connection.setDefaultUseCaches(false);
                    // Specify the content type that we will send binary data
                    connection.setRequestProperty ("Content-Type", "application/octet-stream");
                    ObjectOutputStream outputStream = new ObjectOutputStream(connection.getOutputStream());
                    outputStream.writeObject(value);
                    outputStream.flush();
                    outputStream.close();
                } catch (MalformedURLException ex) {
                    System.out.println(ex.getMessage());
                }  catch (IOException ex) {
                        System.out.println(ex.getMessage());
    }servlet code here ..
    public class TestServlet extends HttpServlet {
         * Processes requests for both HTTP <code>GET</code> and <code>POST</code> methods.
         * @param request servlet request
         * @param response servlet response
         * @throws ServletException if a servlet-specific error occurs
         * @throws IOException if an I/O error occurs
        protected void processRequest(HttpServletRequest request, HttpServletResponse response)
                throws ServletException, IOException {
             System.out.println(" in servlet -----------");
            response.setContentType("text/html;charset=UTF-8");
            PrintWriter out = response.getWriter();
            ObjectInputStream inputFromApplet = null;
            Intermediate aStudent = null;
            BufferedReader inTest = null;
            try {         
                // get an input stream from the applet
                inputFromApplet = new ObjectInputStream(request.getInputStream());
                // read the serialized object data from applet
                data = (Intermediate) inputFromApplet.readObject();
                System.out.println("userid in servlet -----------"+ data.getUserId());
                inputFromApplet.close();
            } catch (Exception e) {
                e.printStackTrace();
                System.err.println("WARNING! filename.path JNDI not found");
            } finally {
                out.close();
        @Override
        protected void doGet(HttpServletRequest request, HttpServletResponse response)
                throws ServletException, IOException {
            System.out.println(" in foGet -----------");
            processRequest(request, response);
         * Handles the HTTP <code>POST</code> method.
         * @param request servlet request
         * @param response servlet response
         * @throws ServletException if a servlet-specific error occurs
         * @throws IOException if an I/O error occurs
        @Override
        protected void doPost(HttpServletRequest request, HttpServletResponse response)
                throws ServletException, IOException {
            System.out.println(" in doPost -----------");
            processRequest(request, response);
         * Returns a short description of the servlet.
         * @return a String containing servlet description
        @Override
        public String getServletInfo() {
            return "Short description";
        }// </editor-fold>
    }the Intermediate class ..
    import java.io.Serializable;
    public class Intermediate implements Serializable{
    String userId;
        public String getUserId() {
            return userId;
        public void setUserId(String userId) {
            this.userId = userId;
    }

    Hi,
    well i am not able to get any value from connection.getOutputStream() and i doubt my applet is not able to hit the servlet. could you review my code and tell me if it has some bug somewhere. and more over i want to know how to send multiple file data from applet to servlet . i want some sample or example if possible.
    do share if you have any experience of this sort..
    Thanks.

  • JDBC MS Access--- cannot extract entry with null value with data type Meta

    I'm trying to extract a data entry with null value by using JDBC. The database is MS Access.
    The question is how to extract null entry with data type memo? The following code works when the label has data type Text, but it throws sqlException when the data type is memo.
    Any advice will be appreciated! thanks!
    Following are the table description and JDBC code:
    test table has the following attributes:
    Field name Data Type
    name Text
    label Memo
    table contents:
    name label
    me null
    you gates
    Code:
    String query = "SELECT name, label FROM test where name like 'me' ";
    ResultSet rs = stmt.executeQuery(query);
    while (rs.next())
    String name = rs.getString("name");
    rs.getString("val");
    String label = rs.getString("label");
    System.out.println("\t"+name+"\t"+label);
    catch (SQLException ex)
    System.out.println(ex.getSQLState());
    System.out.println(ex.getErrorCode());
    System.out.println("in sqlexception");
    output:
    C:\Temp\SEFormExtractor>java DBTest
    yet SELECT name, label FROM test
    null
    0
    in sqlexception

    The question is how to extract null entry with data type memo?Okay, what you need to do is this:
    if (rs.getString("val") == null)
      // do something
    }This way, when it's a null value, you can check it first, and then handle it how you want, rather than getting an exception.

Maybe you are looking for