Need Help with command line arguments for a class method

Hey guys,
I'm fairly new to programming in java.
I want to a write a class method that adds up its command line arguments which are numbers. For example, if the input was .... 5 2 3....then the output would be 10.
I have been told to use the Convert to convert a string to a double. I'm ok for writing the class method but I have no idea how to use Convert and why I need it in the method.
Can anybody help please?

Hey guys,
I'm fairly new to programming in java.
I want to a write a class method that adds up its
command line arguments which are numbers. For
example, if the input was .... 5 2 3....then the
output would be 10.Okay. So you would receive the numbers to add as the String[] argument to a main method. The steps are simple:
1) declare a variable for the count
2) for each String in the array:
2.1) extract the value as a double
2.2) add this to the count
3) output the resulting count
I have been told to use the Convert to convert a
string to a double.
I'm ok for writing the class
method but I have no idea how to use ConvertThere is no class Convert in the Java API.
and why
I need it in the method. Do you understand you need to somehow convert each String to a double (step 2.1)? Since Convert is unknown to me, maybe you should just take a look at class Double. It can help you do step 2.1, the rest should be trivial enough.
http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Double.html
Give it a go and feel free to post back with a specific problem you are having, accurately described if you please :-)

Similar Messages

  • Setting Command Line Arguments for my Class

    HI,
    How do I set the command line arguments for my debug class. For example , I would like my user to type :
    java Debug -LEVEL1
    What should I do to implement this behaviour.
    Thanks in advance...

         public static void main (String[] args){
              if(args.length > 0){
                   int j = 0;
                   BMsearch search = new BMsearch();
                   try{
                        while (j < args.length){
                             if(args[j].equalsIgnoreCase(ONE_PATERN)){
                                  search.addPaternForSearch(args[j+1]);
                                  j = j+2;
                             else if (args[j].equalsIgnoreCase(PATERNLIST)){
                                  j++;
                                  while( ! (args[j].startsWith("-")) ){
                                       search.addPaternForSearch(args[j]);
                                       j++;
                                  }//end while
                             else if (args[j].equalsIgnoreCase(PATERNFILE)){
                                  j++;
                                  search.readPaternFile(args[j]);
                                  j++;
                             else if(args[j].equalsIgnoreCase(MATCH_H)){
                                  search.heuristic = MATCH_HEURISTIC;
                                  j++;
                             else if(args[j].equalsIgnoreCase(MATCH_H2)){
                                  search.heuristic = MATCH_HEURISTIC_TWO;
                                  j++;
                             else if(args[j].equalsIgnoreCase(OCC_H)){
                                  search.heuristic = OCC_HEURISTIC;
                                  j++;
                             else if(args[j].equalsIgnoreCase(COMB_H)){
                                  search.heuristic = COMBINED_HEURISTIC;
                                  j++;
                             else if(args[j].equalsIgnoreCase(JAVA_S)){
                                  search.heuristic = JAVA_NATIVE;
                                  j++;
                             else if(args[j].equalsIgnoreCase(TEXTFILE)){
                                  j++;
                                  search.readFileIn(args[j]);
                                  j++;
                             else if(args[j].equalsIgnoreCase(TEXTURL)){
                                  j++;
                                  search.readURLFileIn(args[j]);
                                  j++;
                             else if(args[j].equalsIgnoreCase(STOPatFIRST)){
                                  search.searchall = false;
                                  j++;
                             else if(args[j].equalsIgnoreCase(STOPatLAST)){
                                  search.searchall = true;
                                  j++;
                             else if(args[j].equalsIgnoreCase(VERBOSE)){
                                  search.verbose = true;
                                  j++;
                             else if(args[j].equalsIgnoreCase("-h") || args[j].equalsIgnoreCase("-help")){
                                  printHelp();
                                  Start = false;
                                  break;
                             else{
                                  System.out.println(" Error while parsing Parameter. ");
                                  System.out.println(" type java BMsearch -help for all Options");
                                  Start = false;
                                  break;
                        }// end outer while
                   catch(Exception e){
                        System.out.println(" Error while parsing Parameter. ");
                        System.out.println(" type java BMsearch -help for all Options");
                        Start = false;
                        j = args.length;
                   if(Start){
                        if(search.verbose)System.out.println(" Parameter parsed, beginning with search ...");
                             search.starttimeTotal = System.currentTimeMillis();
                        search.search();
                        search.stoptimeTotal = System.currentTimeMillis();
                        System.out.println(" Whole search took:  " + (search.stoptimeTotal - search.starttimeTotal) + " milliseconds.(Brutto) ");
              else{
                   System.out.println(" Error while parsing Parameter. ");
                   System.out.println(" type java BMsearch -help for all Options");
         }//end MAINThis is takem from one of my command line classe (a Boyer Moore Pattern-Matching application from an exercise). I don't know if this is the best way, but thats what I have done there for passing some arguments, where the order of them isn't pre-given (you can pass the params in the order you want).
    The CAPITAL vars are pre-defined final Strings holding the param-names, e.g.
    public static final String ONE_PATERN = "-p";
    public static final String PATERNLIST = "-plist";
    public static final String PATERNFILE = "-pfile";Another trick sometimes used in Linux/Unix, if you have only false/true combinations, are numbers from pow 2 (2,4,8,16). In C they are used because of the binary representation, but it has some benefits. E.g. a value of 2 (0010) and another true set on 4 (0100) results binary in 6 (0110), so you can mix parameters in only one value, and with a byte - array you could check, if the flag for a given param is set. But this way is a little tricky for the end-user.

  • I think I need help with driver (software) settings for D110a

    I think I need help with driver (software) settings for D110a all-in-one
    Product: D110a all-in-one
    OS: Windows XP Professional
    Error messages: None
    Changes before problem appeared: None--new installation
    The quality of photo images (mostly JPG files) in printouts is awful even though the files display beautifully on the PC screen. I am using
    IrfanView software for displaying/printing. As far as I can tell, IrfanView is not the problem.
    When I print the same images on a Deskjet 5150 attached to a different PC also running XP Pro and IrfanView, the quality of the printouts is at
    least acceptable, Some would probably say good or very good.
    It's dificult to explain in words the problem with the printouts. A picture of really pretty vegetables (squashes, tomatoes, watermelon, etc) comes
    out much too red. Moreover, the red, which appears shaded on the screen, seems to be all one shade in the D110a printouts.
    Something similar happens to a view of a huge tree in full leaf. On screen, there are subtle variations in the "greenness" of the leaves. In the
    printout, all green is the same shade. In the same printout, the trunk of the tree is all a single shade of grey. It isn;t even obvious that the
    trunk is a round, solid object.
    I liken the effect to audio that disappears entirely when you lower the volume and gets clipped into square waves in even moderately loud passages.
    I don't know whether the D110a driver software permits adjusting the parameters that appear to be set incorrectly, and if adjustments are possible,
    how I would identify which parameters to adjust, how I would access them, or how I would adjust them. I'm hoping that someone can help. Thanks.
    I forgot to mention that I have used the diagnostic application and it tells me that there are no problems.
    e-mail me at [email protected]

    brazzmonkey wrote:
    Hi everyone,
    I noticed the following message when network starts on my gateway
    Warning: This functionality is deprecated.
    Please refer to /etc/rc.conf on how to define a single wired
    connection, or use a utility such as netcfg.
    Then I realized the way network settings should be written in rc.conf has changed. But I can't figure out how this should be done.
    Currently, my set up is the following (old way):
    INTERFACES=(eth0 eth1)
    eth0="dhcp"
    eth1="eth1 192.168.0.10 netmask 255.255.255.0 broadcast 192.168.0.255"
    ROUTES=(!gateway)
    eth0 is on DHCP because the IP is dynamically assigned my ISP.
    eth1 has a fix IP because it's on the LAN side.
    No problem to use DHCP on eth0 with the new settings.
    But for eth1, I don't know what I am supposed to write for gateway.
    Wiki isn't clear on that one either, and it looks like many articles still refer to the old way.
    Any guidance appreciated, thanks.
    brazzmonkey,
    you can't define 2 interfaces the old way (even though I saw some tricky workaround somewhere in the forums).
    Use, f.e., netcfg:
    Comment your old lines.
    In /etc/rc.conf insert:
    NETWORKS=(Eth0-dhcp Eth1-static)
    DAEMONS=(..... !network @net-profiles ....)
    In /etc/network.d create 2 files:
    First one is named  Eth0-dhcp.
    Contents:
    CONNECTION="ethernet"
    DESCRIPTION="Whatever text"
    INTERFACE=eth0
    HOSTNAME="your hostname"
    IP="dhcp"
    DHCP_TIMEOUT=15
    Second one is named Eth1-static.
    Contents:
    CONNECTION='ethernet'
    DESCRIPTION='whatver'
    INTERFACE='eth1'
    HOSTNAME='hname'
    IP='static'
    ADDR='192.168.0.10'
    GATEWAY='192.168.0.1' # your gateway IP
    DNS=('192.168.0.1') # your DNS server
    The names Eth0-dhcp and Eth1-static are not magic. They just must be the same in rc.conf and in /etc/network.d.
    Hope it helps.
    mektub
    PS: netcfg must be installed.
    Last edited by Mektub (2011-07-20 14:07:05)

  • Need help with a activation code for Adobe Acrobat X Standard for my PC,, Don't have older version serial numbers,  threw programs away,  only have Adobe Acrobat X Standard,  need a code to unlock program?

    Need help with a activation code for Adobe Acrobat X Standard for my PC, Don't have older Version of Adobe Acrobat 9, 8 or 7. 

    You don't need to install the older version, you only need the serial number from your original purchase. If you don't have them to hand, did you register? If so, they should be in your Adobe account. If not you really need to contact Adobe, though it isn't clear they will be able to do anything without some proof of purchase etc.

  • How To Run An External .exe File With Command Line Arguments

    Hiya, could anyone tell me how I can run an external .exe file with command line arguments in Java, and if possible catch any printouts the external .exe file prints to the command line.
    Thanks.

    Using the Runtime.exec() command. And read this:
    http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html

  • I need help with downgradeing my ios for my ipod touch 4th gen

    i need help with downgradeing my ios for my ipod touch 4th gen

    As has alwys been the case, you cannot go back.
    Sorry

  • Executing another program with command line arguments

    I am very new to Java, so bare with me.
    I have written an encryption/decryption program in C (that accepts command line arguments of the key, mode (encrypt/decrypt), and file), and I have written a GUI for it in Java. It accepts the filename (and has a button which opens the "File/Open" dialog), key, and mode, and has a button to Start the process of the encryption. I'd like for that "Start" button to call my encryption program in C (eep.exe) with the command line arguments of the file, key, and mode. This is what I have written so far :
    Start = new JButton("Start");
    Start.setBounds(150, 180, 90, 25);
    Start.addActionListener(new ActionListener() {     
    public void actionPerformed(ActionEvent ae) {
    Desktop.open(new File("C:\\eep.exe" + " " + filename + " " + mode + " " + key));
    However, I get the error "Cannot make a static reference to the non-static method open(File) from the type Desktop" on the Desktop.open command.
    What should I do? Is Desktop.Open the right way to go about this? If not, what is the right way to go about it?
    Thanks in advance.

    That has helped greatly, but I cannot pass command line arguments to it.
    Using :
    try {
        Desktop.getDesktop().open(new File("C:\\eep.exe"));
    catch (Exception e) {
       System.out.println("Error executing.");
    }I can execute eep.exe, but when I try to pass command line arguments to it, such as
    Desktop.getDesktop().open(new File("C:\\eep.exe" + " " + filename));it fails, get caught and prints "Error Executing."
    I have also tried loading the program, as well as some command line arguments into an array of strings :
    String[] cmdArray = {"C:\\eep.exe", filename};
    Desktop.getDesktop().open(new File(cmdArray));But it gives me the error "The constructor File(String[]) is undefined" on the
    new File (cmdArray)part of the command.

  • Need Help with creating Line Graph Chart

    I have the following XML Data
    <DATA>
    <PERCENT_ROW>
    <YEAR>2007</YEAR>
    <PERIOD>3</PERIOD>
    <MATERIAL_TYPE>C</MATERIAL_TYPE>
    <BRANCHDESC>Longview</BRANCHDESC>
    <LOCATION>30</LOCATION>
    <QUARTERDESC>Quarter 1</QUARTERDESC>
    <CURRPERIOD>Mar 2007</CURRPERIOD>
    <VALUECURRENTPERIOD>99.9</VALUECURRENTPERIOD>
    <QUARTERVALUE>100</QUARTERVALUE>
    <YTDVALUE>100</YTDVALUE>
    <STDCURRENTPERIOD>99.2</STDCURRENTPERIOD>
    <VARIANCE_STD>-.7</VARIANCE_STD>
    <VARIANCE_STD_PERCENT>-.7</VARIANCE_STD_PERCENT>
    <CURRENT_12MMA>99.97</CURRENT_12MMA>
    <PRIOR_12MMA>0</PRIOR_12MMA>
    <CURRPERSUB1>Feb 2007</CURRPERSUB1>
    <VALUECURRENTPERIODSUB1>100</VALUECURRENTPERIODSUB1>
    <CURRPERSUB2>Jan 2007</CURRPERSUB2>
    <VALUECURRENTPERIODSUB2>100</VALUECURRENTPERIODSUB2>
    <CURRPERSUB3>Dec 2006</CURRPERSUB3>
    <VALUECURRENTPERIODSUB3>0</VALUECURRENTPERIODSUB3>
    <CURRPERSUB4>Nov 2006</CURRPERSUB4>
    <VALUECURRENTPERIODSUB4>0</VALUECURRENTPERIODSUB4>
    <CURRPERSUB5>Oct 2006</CURRPERSUB5>
    <VALUECURRENTPERIODSUB5>0</VALUECURRENTPERIODSUB5>
    <CURRPERSUB6>Sep 2006</CURRPERSUB6>
    <VALUECURRENTPERIODSUB6>0</VALUECURRENTPERIODSUB6>
    <CURRPERSUB7>Aug 2006</CURRPERSUB7>
    <VALUECURRENTPERIODSUB7>0</VALUECURRENTPERIODSUB7>
    <CURRPERSUB8>Jul 2006</CURRPERSUB8>
    <VALUECURRENTPERIODSUB8>0</VALUECURRENTPERIODSUB8>
    <CURRPERSUB9>Jun 2006</CURRPERSUB9>
    <VALUECURRENTPERIODSUB9>0</VALUECURRENTPERIODSUB9>
    <CURRPERSUB10>May 2006</CURRPERSUB10>
    <VALUECURRENTPERIODSUB10>0</VALUECURRENTPERIODSUB10>
    <CURRPERSUB11>Apr 2006</CURRPERSUB11>
    <VALUECURRENTPERIODSUB11>0</VALUECURRENTPERIODSUB11>
    </PERCENT_ROW>
    <PERCENT_ROW>
    <YEAR>2007</YEAR>
    <PERIOD>3</PERIOD>
    <MATERIAL_TYPE>C</MATERIAL_TYPE>
    <BRANCHDESC>Oakland</BRANCHDESC>
    <LOCATION>31</LOCATION>
    <QUARTERDESC>Quarter 1</QUARTERDESC>
    <CURRPERIOD>Mar 2007</CURRPERIOD>
    <VALUECURRENTPERIOD>100</VALUECURRENTPERIOD>
    <QUARTERVALUE>100</QUARTERVALUE>
    <YTDVALUE>100</YTDVALUE>
    <STDCURRENTPERIOD>100</STDCURRENTPERIOD>
    <VARIANCE_STD>0</VARIANCE_STD>
    <VARIANCE_STD_PERCENT>0</VARIANCE_STD_PERCENT>
    <CURRENT_12MMA>100</CURRENT_12MMA>
    <PRIOR_12MMA>0</PRIOR_12MMA>
    <CURRPERSUB1>Feb 2007</CURRPERSUB1>
    <VALUECURRENTPERIODSUB1>100</VALUECURRENTPERIODSUB1>
    <CURRPERSUB2>Jan 2007</CURRPERSUB2>
    <VALUECURRENTPERIODSUB2>100</VALUECURRENTPERIODSUB2>
    <CURRPERSUB3>Dec 2006</CURRPERSUB3>
    <VALUECURRENTPERIODSUB3>0</VALUECURRENTPERIODSUB3>
    <CURRPERSUB4>Nov 2006</CURRPERSUB4>
    <VALUECURRENTPERIODSUB4>0</VALUECURRENTPERIODSUB4>
    <CURRPERSUB5>Oct 2006</CURRPERSUB5>
    <VALUECURRENTPERIODSUB5>0</VALUECURRENTPERIODSUB5>
    <CURRPERSUB6>Sep 2006</CURRPERSUB6>
    <VALUECURRENTPERIODSUB6>0</VALUECURRENTPERIODSUB6>
    <CURRPERSUB7>Aug 2006</CURRPERSUB7>
    <VALUECURRENTPERIODSUB7>0</VALUECURRENTPERIODSUB7>
    <CURRPERSUB8>Jul 2006</CURRPERSUB8>
    <VALUECURRENTPERIODSUB8>0</VALUECURRENTPERIODSUB8>
    <CURRPERSUB9>Jun 2006</CURRPERSUB9>
    <VALUECURRENTPERIODSUB9>0</VALUECURRENTPERIODSUB9>
    <CURRPERSUB10>May 2006</CURRPERSUB10>
    <VALUECURRENTPERIODSUB10>0</VALUECURRENTPERIODSUB10>
    <CURRPERSUB11>Apr 2006</CURRPERSUB11>
    <VALUECURRENTPERIODSUB11>0</VALUECURRENTPERIODSUB11>
    </PERCENT_ROW>
    <PERCENT_ROW>
    <YEAR>2007</YEAR>
    <PERIOD>3</PERIOD>
    <MATERIAL_TYPE>C</MATERIAL_TYPE>
    <BRANCHDESC>Seattle</BRANCHDESC>
    <LOCATION>32</LOCATION>
    <QUARTERDESC>Quarter 1</QUARTERDESC>
    <CURRPERIOD>Mar 2007</CURRPERIOD>
    <VALUECURRENTPERIOD>12.4</VALUECURRENTPERIOD>
    <QUARTERVALUE>18.7</QUARTERVALUE>
    <YTDVALUE>18.7</YTDVALUE>
    <STDCURRENTPERIOD>-2527.7</STDCURRENTPERIOD>
    <VARIANCE_STD>-2540.1</VARIANCE_STD>
    <VARIANCE_STD_PERCENT>100.5</VARIANCE_STD_PERCENT>
    <CURRENT_12MMA>18.7</CURRENT_12MMA>
    <PRIOR_12MMA>0</PRIOR_12MMA>
    <CURRPERSUB1>Feb 2007</CURRPERSUB1>
    <VALUECURRENTPERIODSUB1>37.2</VALUECURRENTPERIODSUB1>
    <CURRPERSUB2>Jan 2007</CURRPERSUB2>
    <VALUECURRENTPERIODSUB2>6.5</VALUECURRENTPERIODSUB2>
    <CURRPERSUB3>Dec 2006</CURRPERSUB3>
    <VALUECURRENTPERIODSUB3>0</VALUECURRENTPERIODSUB3>
    <CURRPERSUB4>Nov 2006</CURRPERSUB4>
    <VALUECURRENTPERIODSUB4>0</VALUECURRENTPERIODSUB4>
    <CURRPERSUB5>Oct 2006</CURRPERSUB5>
    <VALUECURRENTPERIODSUB5>0</VALUECURRENTPERIODSUB5>
    <CURRPERSUB6>Sep 2006</CURRPERSUB6>
    <VALUECURRENTPERIODSUB6>0</VALUECURRENTPERIODSUB6>
    <CURRPERSUB7>Aug 2006</CURRPERSUB7>
    <VALUECURRENTPERIODSUB7>0</VALUECURRENTPERIODSUB7>
    <CURRPERSUB8>Jul 2006</CURRPERSUB8>
    <VALUECURRENTPERIODSUB8>0</VALUECURRENTPERIODSUB8>
    <CURRPERSUB9>Jun 2006</CURRPERSUB9>
    <VALUECURRENTPERIODSUB9>0</VALUECURRENTPERIODSUB9>
    <CURRPERSUB10>May 2006</CURRPERSUB10>
    <VALUECURRENTPERIODSUB10>0</VALUECURRENTPERIODSUB10>
    <CURRPERSUB11>Apr 2006</CURRPERSUB11>
    <VALUECURRENTPERIODSUB11>0</VALUECURRENTPERIODSUB11>
    </PERCENT_ROW>
    <PERCENT_ROW>
    <YEAR>2007</YEAR>
    <PERIOD>3</PERIOD>
    <MATERIAL_TYPE>C</MATERIAL_TYPE>
    <BRANCHDESC>Yakima</BRANCHDESC>
    <LOCATION>33</LOCATION>
    <QUARTERDESC>Quarter 1</QUARTERDESC>
    <CURRPERIOD>Mar 2007</CURRPERIOD>
    <VALUECURRENTPERIOD>36.4</VALUECURRENTPERIOD>
    <QUARTERVALUE>68.2</QUARTERVALUE>
    <YTDVALUE>68.2</YTDVALUE>
    <STDCURRENTPERIOD>-5517.2</STDCURRENTPERIOD>
    <VARIANCE_STD>-5553.6</VARIANCE_STD>
    <VARIANCE_STD_PERCENT>100.7</VARIANCE_STD_PERCENT>
    <CURRENT_12MMA>68.17</CURRENT_12MMA>
    <PRIOR_12MMA>0</PRIOR_12MMA>
    <CURRPERSUB1>Feb 2007</CURRPERSUB1>
    <VALUECURRENTPERIODSUB1>68.6</VALUECURRENTPERIODSUB1>
    <CURRPERSUB2>Jan 2007</CURRPERSUB2>
    <VALUECURRENTPERIODSUB2>99.5</VALUECURRENTPERIODSUB2>
    <CURRPERSUB3>Dec 2006</CURRPERSUB3>
    <VALUECURRENTPERIODSUB3>0</VALUECURRENTPERIODSUB3>
    <CURRPERSUB4>Nov 2006</CURRPERSUB4>
    <VALUECURRENTPERIODSUB4>0</VALUECURRENTPERIODSUB4>
    <CURRPERSUB5>Oct 2006</CURRPERSUB5>
    <VALUECURRENTPERIODSUB5>0</VALUECURRENTPERIODSUB5>
    <CURRPERSUB6>Sep 2006</CURRPERSUB6>
    <VALUECURRENTPERIODSUB6>0</VALUECURRENTPERIODSUB6>
    <CURRPERSUB7>Aug 2006</CURRPERSUB7>
    <VALUECURRENTPERIODSUB7>0</VALUECURRENTPERIODSUB7>
    <CURRPERSUB8>Jul 2006</CURRPERSUB8>
    <VALUECURRENTPERIODSUB8>0</VALUECURRENTPERIODSUB8>
    <CURRPERSUB9>Jun 2006</CURRPERSUB9>
    <VALUECURRENTPERIODSUB9>0</VALUECURRENTPERIODSUB9>
    <CURRPERSUB10>May 2006</CURRPERSUB10>
    <VALUECURRENTPERIODSUB10>0</VALUECURRENTPERIODSUB10>
    <CURRPERSUB11>Apr 2006</CURRPERSUB11>
    <VALUECURRENTPERIODSUB11>0</VALUECURRENTPERIODSUB11>
    </PERCENT_ROW>
    <PERCENT_ROW>
    <YEAR>2007</YEAR>
    <PERIOD>3</PERIOD>
    <MATERIAL_TYPE>C</MATERIAL_TYPE>
    <BRANCHDESC>Twin Falls</BRANCHDESC>
    <LOCATION>34</LOCATION>
    <QUARTERDESC>Quarter 1</QUARTERDESC>
    <CURRPERIOD>Mar 2007</CURRPERIOD>
    <VALUECURRENTPERIOD>100</VALUECURRENTPERIOD>
    <QUARTERVALUE>99.8</QUARTERVALUE>
    <YTDVALUE>99.8</YTDVALUE>
    <STDCURRENTPERIOD>100</STDCURRENTPERIOD>
    <VARIANCE_STD>0</VARIANCE_STD>
    <VARIANCE_STD_PERCENT>0</VARIANCE_STD_PERCENT>
    <CURRENT_12MMA>99.8</CURRENT_12MMA>
    <PRIOR_12MMA>0</PRIOR_12MMA>
    <CURRPERSUB1>Feb 2007</CURRPERSUB1>
    <VALUECURRENTPERIODSUB1>99.4</VALUECURRENTPERIODSUB1>
    <CURRPERSUB2>Jan 2007</CURRPERSUB2>
    <VALUECURRENTPERIODSUB2>100</VALUECURRENTPERIODSUB2>
    <CURRPERSUB3>Dec 2006</CURRPERSUB3>
    <VALUECURRENTPERIODSUB3>0</VALUECURRENTPERIODSUB3>
    <CURRPERSUB4>Nov 2006</CURRPERSUB4>
    <VALUECURRENTPERIODSUB4>0</VALUECURRENTPERIODSUB4>
    <CURRPERSUB5>Oct 2006</CURRPERSUB5>
    <VALUECURRENTPERIODSUB5>0</VALUECURRENTPERIODSUB5>
    <CURRPERSUB6>Sep 2006</CURRPERSUB6>
    <VALUECURRENTPERIODSUB6>0</VALUECURRENTPERIODSUB6>
    <CURRPERSUB7>Aug 2006</CURRPERSUB7>
    <VALUECURRENTPERIODSUB7>0</VALUECURRENTPERIODSUB7>
    <CURRPERSUB8>Jul 2006</CURRPERSUB8>
    <VALUECURRENTPERIODSUB8>0</VALUECURRENTPERIODSUB8>
    <CURRPERSUB9>Jun 2006</CURRPERSUB9>
    <VALUECURRENTPERIODSUB9>0</VALUECURRENTPERIODSUB9>
    <CURRPERSUB10>May 2006</CURRPERSUB10>
    <VALUECURRENTPERIODSUB10>0</VALUECURRENTPERIODSUB10>
    <CURRPERSUB11>Apr 2006</CURRPERSUB11>
    <VALUECURRENTPERIODSUB11>0</VALUECURRENTPERIODSUB11>
    </PERCENT_ROW>
    <PERCENT_ROW>
    <YEAR>2007</YEAR>
    <PERIOD>3</PERIOD>
    <MATERIAL_TYPE>C</MATERIAL_TYPE>
    <BRANCHDESC>Spanish Fork</BRANCHDESC>
    <LOCATION>35</LOCATION>
    <QUARTERDESC>Quarter 1</QUARTERDESC>
    <CURRPERIOD>Mar 2007</CURRPERIOD>
    <VALUECURRENTPERIOD>7.7</VALUECURRENTPERIOD>
    <QUARTERVALUE>10.2</QUARTERVALUE>
    <YTDVALUE>10.2</YTDVALUE>
    <STDCURRENTPERIOD>-6016.2</STDCURRENTPERIOD>
    <VARIANCE_STD>-6023.9</VARIANCE_STD>
    <VARIANCE_STD_PERCENT>100.1</VARIANCE_STD_PERCENT>
    <CURRENT_12MMA>10.23</CURRENT_12MMA>
    <PRIOR_12MMA>0</PRIOR_12MMA>
    <CURRPERSUB1>Feb 2007</CURRPERSUB1>
    <VALUECURRENTPERIODSUB1>14.9</VALUECURRENTPERIODSUB1>
    <CURRPERSUB2>Jan 2007</CURRPERSUB2>
    <VALUECURRENTPERIODSUB2>8.1</VALUECURRENTPERIODSUB2>
    <CURRPERSUB3>Dec 2006</CURRPERSUB3>
    <VALUECURRENTPERIODSUB3>0</VALUECURRENTPERIODSUB3>
    <CURRPERSUB4>Nov 2006</CURRPERSUB4>
    <VALUECURRENTPERIODSUB4>0</VALUECURRENTPERIODSUB4>
    <CURRPERSUB5>Oct 2006</CURRPERSUB5>
    <VALUECURRENTPERIODSUB5>0</VALUECURRENTPERIODSUB5>
    <CURRPERSUB6>Sep 2006</CURRPERSUB6>
    <VALUECURRENTPERIODSUB6>0</VALUECURRENTPERIODSUB6>
    <CURRPERSUB7>Aug 2006</CURRPERSUB7>
    <VALUECURRENTPERIODSUB7>0</VALUECURRENTPERIODSUB7>
    <CURRPERSUB8>Jul 2006</CURRPERSUB8>
    <VALUECURRENTPERIODSUB8>0</VALUECURRENTPERIODSUB8>
    <CURRPERSUB9>Jun 2006</CURRPERSUB9>
    <VALUECURRENTPERIODSUB9>0</VALUECURRENTPERIODSUB9>
    <CURRPERSUB10>May 2006</CURRPERSUB10>
    <VALUECURRENTPERIODSUB10>0</VALUECURRENTPERIODSUB10>
    <CURRPERSUB11>Apr 2006</CURRPERSUB11>
    <VALUECURRENTPERIODSUB11>0</VALUECURRENTPERIODSUB11>
    </PERCENT_ROW>
    </DATA>
    Note that each Branch_Desc has 12 periods called CURRPERIOD,CURPERSUB1,CURPERSUB2 ...... and 12 values for those periods as VALUECURRENTPERIOD, VALUECURRENTPERIODSUB1, VALUECURRENTPERIODSUB2......
    I need to create a Line Graph for each Branch for the 12 periods as defined above where VALUECURRENTPERIOD, VALUECURRENTPERIODSUB1 etc. are the values for that period. The current BIPublisher Chart tool only allows one Value and One Label. In my case I have 12 VALUES (VALUECURRENTPERIOD etc.) and 12 LABELS (CURRPERIOD, CURPERSUB1 etc.). The SERIES or LEGEND should be the Branch Desc . So what I am looking for is to plot values(12 values) for 6 branches (so six lines) over a period of time (12 periods).

    Hi Tim,
    We have this XML data calculated from several tables where the layout was in the format of One account(a Branch in this case) and 12 periodic values for the same . So reformatting the XML is not going to be easy as the source data is like this itself. I tried un-pivioting the table (as this one is already pivoted) but it looks like Oracle doesn't support this feature yet, but is suported in DB2 or SQL. Please take a look at this link
    http://blogs.ittoolbox.com/database/technology/archives/unpivot-query-12798?close=true
    So I am stuck with the data in this format and users want a line graph for each branch over he period of time. May be somone on this forum can figure out how to un-pivot a table in Oracle. Thanks for your help in advance.

  • Problem associated with Command Line arguments

    hi ,
    I am not able to pass a file path as command line argument in java.
    Actually i want to run a java program from the command prompt passing a file path . Something like this i tried to do , but its not working.
    D:\VISHAL\src> java CopyFile C:\Documents and Settings\Administrator\Desktop\link.txt
    where ,
    CopyFile is the name of my class which i am going to run
    C:\Documents and Settings\Administrator\Desktop\link.txt is the argument.
    Can anyone tell me whether a java program accepts an argument like this, if yes please tell me the exact syntax..
    Thanks
    Vishal J
    Message was edited by:
    vishal_vj

    is there any other way of solving this?Y don't U try it out with the logic as mentioned
    below it wud be the case if U r not going with
    java CopyFile "C:\Documents and
    Settings\Administrator\Desktop\link.txt" 1
    String filepath = new String();
    for(int i = 0; i < Arg.length; i++)
    filepath.append(Arg);
    File f = new File(filepath);
    What????  This is a non-solution to a non-problem.  First of all, you would be constructing a filename without spaces, when the real path contains spaces.  Secondly, even if you did insert spaces it would not matter.  What if the String (and it does not have to be a filename) contained tabs rather than spaces.  The real (and really only) solution to the problem is to put quotes around the argument, for the exact reason stated in my last post.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Launch executable with command line arguments

    I have a programmer that I need to launch in my cvi code.  I tried the system command and lauchexecutable command but cannot get the programmer to lauch correctly.  If I run it from the command prompt or create a windows shortcut it works fine.  Here is the shortcut I created:
    C:\TPD\SAVS20P3\asix\up\up.exe /e c:\tpd\savs20p3\q33.hex/erase /q /p
    I'm trying to run the up.exe software with /e c:\tpd\v20_hex\v20.hex /erase /q /p as the command line paramters.
    I tried the following code which created the above path with command line
     strcpy(filename,"C:\\tpd\\savs20p3\\asix\\up\\up.exe /e c:\\tpd\\savs20p3\\hex_ee\\");   ///e c:\\tpd\\savs20p3\\hex_ee\\"");
      strcat(filename, hfile);//hex file name will change dynamically
      strcat(filename, "/q /p");
    I then tried LaunchExecutable(filename) and system(filename).  The system functions gives an error.  Its trying to lauch the /e c:\tpd\v20_hex\v20.hex file
    any suggestions.  I beieve its a simple syntax error.

    Well, apart evident typos in the code you posted, which is not creating the command line you stated, I can only think that before "/q" you should add a space to separate the option from the filename.
    This code should create the correct command line:
    strcpy (hfile, "c:\\tpd\\v20_hex\\v20.hex");
    strcpy (filename, "C:\\tpd\\savs20p3\\asix\\up\\up.exe /e ");
    strcat (filename, hfile);
    strcat (filename, " /erase /q /p");
    Proud to use LW/CVI from 3.1 on.
    My contributions to the Developer Zone Community
    If I have helped you, why not giving me a kudos?

  • [solved]Need help with a bash script for MOC conky artwork.

    I need some help with a bash script for displaying artwork from MOC.
    Music folders have a file called 'front.jpg' in them, so I need to pull the current directory from MOCP and then display the 'front.jpg' file in conky.
    mocp -Q %file
    gives me the current file playing, but I need the directory (perhaps some way to use only everything after the last  '/'?)
    A point in the right direction would be appreciated.
    thanks, d
    Last edited by dgz (2013-08-29 21:24:28)

    Xyne wrote:
    You should also quote the variables and output in double quotes to make the code robust, e.g.
    filename="$(mocp -Q %file)"
    dirname="${filename%/*}"
    cp "$dirname"/front.jpg ~/backup/art.jpg
    Without the quotes, whitespace will break the code. Even if you don't expect whitespace in any of the paths, it's still good coding practice to include the quotes imo.
    thanks for the tip.
    here it is, anyhow:
    #!/bin/bash
    filename=$(mocp -Q %file)
    dirname=${filename%/*}
    cp ${dirname}/front.jpg ~/backup/art.jpg
    then in conky:
    $alignr${execi 30 ~/bin/artc}${image ~/backup/art.jpg -s 100x100 -p -3,60}
    thanks for the help.
    Last edited by dgz (2013-08-29 21:26:32)

  • Problem with command line argument files and quoted strings

    I'm trying to use the following custom tag:
    -tag com.me.Test.testTag:f:"My Test Tag"
    This works fine when sent straight to the command line, but if I put it in an argument file (@argfile) along with the rest of my command, I get the following error:
    javadoc: Illegal package name: "My Test Tag"
    Any idea why this is happening? If I use a one-word tag header and omit the quotes, javadoc runs with no problems. I'm using Sun's SDK 1.4.1.
    Thanks for your help!
    Linda Howard

    White space is treated a bit differently in an @argfile,
    to enable users to put packages or options on separate lines.
    You might try escaping the spaces:
    "My\ Test\ Tag"
    or using a non-breaking space:
    "My Test Tag"
    What operating system are you on?
    -Doug Kramer
    javadoc team

  • Hi i need help with getting my homework for school

    im in a nine week class that ends tommorw and need help go\etting my program working properly these are the requirements ofr the assignments:
    Modify the Inventory Program by adding a button to the GUI that allows the user to move
    to the first item, the previous item, the next item, and the last item in the inventory. If the
    first item is displayed and the user clicks on the Previous button, the last item should
    display. If the last item is displayed and the user clicks on the Next button, the first item
    should display.
    · Add a company logo to the GUI using Java graphics classes.
    Modify the Inventory Program to include an Add button, a Delete button, and a Modifybutton on the GUI. These buttons should allow the user to perform the corresponding actions on the item name, the number of units in stock, and the price of each unit. An item added to the inventory should have an item number one more than the previous last item. Add a Save button to the GUI that saves the inventory to a C:\data\inventory.dat file. Use exception handling to create the directory and file if necessary. Add a search button to the GUI that allows the user to search for an item in the inventory by the product name. If the product is not found, the GUI should display an appropriate message. If the product is found, the GUI should display that product’s information in the GUI. Post final .class and .java files as an attachment.
    this is what i have there are three java files im puttong in here
    first is the panel frame
    import java.awt.GridLayout;
    import java.awt.BorderLayout;
    import java.awt.FlowLayout;
    import javax.swing.JFrame;
    import javax.swing.JPanel;
    import javax.swing.JButton;
    import javax.swing.JLabel;
    import java.awt.GridBagLayout;
    import java.awt.GridBagConstraints;
    import java.awt.Component;
    import javax.swing.SwingConstants;
    import javax.swing.Icon;
    import javax.swing.JComboBox;
    import javax.swing.JTextArea;
    import javax.swing.JList;
    import java.util.*;
    import java.text.NumberFormat;
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.net.URL;
    import java.io.*;
    import java.util.Scanner;
    import javax.swing.JOptionPane;
    import java.text.NumberFormat;
    public class PanelFrame extends JFrame
         private JPanel buttonJPanel; // panel to hold buttons
         private JButton buttons[]; // array of buttons
         private JLabel label1; // JLabel iventory number
         private JLabel label2; // JLabel product name
         private JLabel label3; // JLabel product price
         private JLabel label4; // JLabel product in stock
         private String p_ProductName; // private variable for the employee name.
         private int p_UnitCount; // private variable for the hours worked.
         private double p_UnitPrice; // private variable for the hourly wage.
         private int p_ItemNumber; // private inventory number
         //create inventory object
         Inventory myInventory = new Inventory ();
    // no-argument constructor
    public PanelFrame()
    super( "Panel Demo" );
    //Add items to the inventory within the Invntory
              myInventory.addItem(new productinfo(1,"Html a Begginers Guide",14,29.99));
              myInventory.addItem(new productinfo(2,"Html 4 for Dummies",6,29.99));
              myInventory.addItem(new productinfo(3,"Visio Step by Step",7,24.99));
              myInventory.addItem(new productinfo(4,"APA Publication Manual",14,47.99));
              myInventory.addItem(new productinfo(5,"The Gregg Reference Manual",14,37.56));
    setLayout( new FlowLayout() ); // set frame layout
    // JLabel constructor with a string argument
              label1 = new JLabel( "Inventory Number:%s: %d\n ",p_ItemNumber );
              label1.setToolTipText( "This is Inventory number" );
              add( label1 ); // add label1 to JFrame
              label2 = new JLabel( "\n\nProduct Name: %s: %s\n", p_ProductName);
              label2.setToolTipText( "This is Product Name" );
              add( label2 ); // add label1 to JFrame
              label3 = new JLabel( "\n\nPrice : %s:$%.2f\n",p_UnitPrice );
              label3.setToolTipText( "This is product Price");
              add( label3 ); // add label1 to JFrame
              label4 = new JLabel( "\n\nQuanity %s: %d\n",p_UnitCount);
              label4.setToolTipText( "This is Quanity in stock: " );
              add( label4 ); // add label1 to JFrame
    buttons = new JButton[ 4 ]; // create buttons array
    buttonJPanel = new JPanel(); // set up panel
    buttonJPanel.setLayout( new GridLayout( 1, buttons.length ) );
              String names[] = { "First", "Previous", "Next", "Last"  };
              JButton buttons[] = new JButton[ names.length ];
              // create and add buttons
              for ( int count = 0; count < buttons.length; count++ )
              buttons[ count ] = new JButton( names[ count ] );
              buttonJPanel.add( buttons[ count ] ); // add button to panel
              } // end for
    // setup the logo for the GUI ...image needs to be in same directory as source code
              URL url = this.getClass().getResource("book103.gif");
              Image img = Toolkit.getDefaultToolkit().getImage(url);
              // scale the image so that it'll fit in the GUI
              Image scaledImage = img.getScaledInstance(100, 100, Image.SCALE_AREA_AVERAGING);
              // create a JLabel with the image as the label's Icon
              Icon logoIcon = new ImageIcon(scaledImage);
              JLabel companyLogoLabel = new JLabel(logoIcon);
              companyLogoLabel.setBorder(BorderFactory.createEmptyBorder(3,3,3,3));
              // add the logo to the GUI
              getContentPane().add(companyLogoLabel, BorderLayout.WEST);
    add( buttonJPanel, BorderLayout.SOUTH ); // add panel to JFrame
    } // end PanelFrame constructor
    } // end class PanelFrame

    this is the original part again with the code tag added
    import java.awt.GridLayout;
    import java.awt.BorderLayout;
    import java.awt.FlowLayout;
    import javax.swing.JFrame;
    import javax.swing.JPanel;
    import javax.swing.JButton;
    import javax.swing.JLabel;
    import java.awt.GridBagLayout;
    import java.awt.GridBagConstraints;
    import java.awt.Component;
    import javax.swing.SwingConstants;
    import javax.swing.Icon;
    import javax.swing.JComboBox;
    import javax.swing.JTextArea;
    import javax.swing.JList;
    import java.util.;
    import java.text.NumberFormat;
    import javax.swing.;
    import java.awt.;
    import java.awt.event.;
    import java.net.URL;
    import java.io.*;
    import java.util.Scanner;
    import javax.swing.JOptionPane;
    import java.text.NumberFormat;
    public class PanelFrame extends JFrame
    private JPanel buttonJPanel; // panel to hold buttons
    private JButton buttons[]; // array of buttons
    private JLabel label1; // JLabel iventory number
    private JLabel label2; // JLabel product name
    private JLabel label3; // JLabel product price
    private JLabel label4; // JLabel product in stock
    private String p_ProductName; // private variable for the employee name.
    private int p_UnitCount; // private variable for the hours worked.
    private double p_UnitPrice; // private variable for the hourly wage.
    private int p_ItemNumber; // private inventory number
    //create inventory object
    Inventory myInventory = new Inventory ();
    // no-argument constructor
    public PanelFrame()
    super( "Panel Demo" );
    //Add items to the inventory within the Invntory
    myInventory.addItem(new productinfo(1,"Html a Begginers Guide",14,29.99));
    myInventory.addItem(new productinfo(2,"Html 4 for Dummies",6,29.99));
    myInventory.addItem(new productinfo(3,"Visio Step by Step",7,24.99));
    myInventory.addItem(new productinfo(4,"APA Publication Manual",14,47.99));
    myInventory.addItem(new productinfo(5,"The Gregg Reference Manual",14,37.56));
    setLayout( new FlowLayout() ); // set frame layout
    // JLabel constructor with a string argument
    label1 = new JLabel( "Inventory Number:%s: %d\n ",p_ItemNumber );
    label1.setToolTipText( "This is Inventory number" );
    add( label1 ); // add label1 to JFrame
    label2 = new JLabel( "\n\nProduct Name: %s: %s\n", p_ProductName);
    label2.setToolTipText( "This is Product Name" );
    add( label2 ); // add label1 to JFrame
    label3 = new JLabel( "\n\nPrice : %s:$%.2f\n",p_UnitPrice );
    label3.setToolTipText( "This is product Price");
    add( label3 ); // add label1 to JFrame
    label4 = new JLabel( "\n\nQuanity %s: %d\n",p_UnitCount);
    label4.setToolTipText( "This is Quanity in stock: " );
    add( label4 ); // add label1 to JFrame
    buttons = new JButton[ 4 ]; // create buttons array
    buttonJPanel = new JPanel(); // set up panel
    buttonJPanel.setLayout( new GridLayout( 1, buttons.length ) );
    String names[] = { "First", "Previous", "Next", "Last" };
    JButton buttons[] = new JButton[ names.length ];
    // create and add buttons
    for ( int count = 0; count < buttons.length; count++ )
    buttons[ count ] = new JButton( names[ count ] );
    buttonJPanel.add( buttons[ count ] ); // add button to panel
    } // end for
    // setup the logo for the GUI ...image needs to be in same directory as source code
    URL url = this.getClass().getResource("book103.gif");
    Image img = Toolkit.getDefaultToolkit().getImage(url);
    // scale the image so that it'll fit in the GUI
    Image scaledImage = img.getScaledInstance(100, 100, Image.SCALE_AREA_AVERAGING);
    // create a JLabel with the image as the label's Icon
    Icon logoIcon = new ImageIcon(scaledImage);
    JLabel companyLogoLabel = new JLabel(logoIcon);
    companyLogoLabel.setBorder(BorderFactory.createEmptyBorder(3,3,3,3));
    // add the logo to the GUI
    getContentPane().add(companyLogoLabel, BorderLayout.WEST);
    add( buttonJPanel, BorderLayout.SOUTH ); // add panel to JFrame
    } // end PanelFrame constructor
    } // end class PanelFrame

  • Need help with Photoshop and "Licensing for this product has stopped working" message. Adobe fix isn't working.

    I am still using CS3. A while back I received an error: "Licensing for this product has stopped working" for my CS3 programs. I used the recovery program suggested by Adobe and was able to get Illustrator, Flash and Dreamweaver to work, but I still can't open Photoshop or In Design. I went back to the Adobe site and did every other trick they suggested to fix the error, but nothing has worked.
    I then tried to uninstall photoshop from my CS3 suite (so I could reinstall) but got a JavaScript Alert: "Critical errors were found in set up. Please see set up log for file details." Seeing as I am not the best with the behind the scenes technical stuff, I have no idea what this means or where the set up log even is. Any help anyone can provide?
    I have had CS3 installed on my computer for over a year. I started having problems about 4 months ago.

    I am having similar problem.  Can't open any of CS3 programs after trying to download Dreamweaver Trial, which wouldn't work because "couldn't remove DLM extention" error message.  So now I can not run Illustrator, Photoshop, or even Adobe Reader.  These are properly licensed for about a year. I get "License for product has stopped working".  Have 2 pending cases open with Adobe support (one for Dreamweaver trial, one for license problem) since 8/3 with NO ANSWERS - It says answers within 1-3 business days.  Was on phone support hold today for over 3 hours before line went dead with no help.  What is up with adobe support?  Can anyone help?

  • Need help with output type EDI for ERS

    All,
    I want to be able to run and ERS settlement and have the invoices created sent via EDI/XML to the supplier.   I have several questions on the set up.
    1)  I have output type ERS6 which is defined as ERS EDI.  I assume because it does not start with Z* this is SAP standard, so I shouldn't have to modify any of this.
    2)  I've added my supplier to this output type. 
    3)  I assume I need to create a partner profile for this supplier?  If so can someone tell me the message type to use?
    Is there any set up I'm missing in this process?   I've executed ERS but do not get an idoc and I'm fairly certain it's because I haven't done the partner profile set-up.
    Thanks for your help.
    Sandra

    Hi,
    You don't have to modify thise setup unless you have any customized requirement.
    You are missing partner profile setup.Carry out the setup and run MRRL tcode to create the idocs
    Enter the following values using tcode WE20.
    Field                                       Value
    Message type                         GSVERF
    Partner type                             LI (vendor)
    Partner function                        LF (vendor)
    Port                                         SUBSYSTEM ( Port to your middleware)
    Output mode                            such as Collect IDocs
    Basic type                                GSVERF01
    Application                                 MR
    Output type                                ERS6 or the type you have defined
    Regards,
    Karuna

Maybe you are looking for