Xml help with project?

Hey guys, Java newbie here, was wondering if anyone could point me in the right direction.
so my co-worker gave me a folder with a bunch of .tif image files and one .xml file. I'm supposed to write Java code to copy a folder with the same name as the folder he gave me, and copy the .xml file into that folder. so the end result is that we have the original folder w/ the .tif files and .xml file, and one copy folder with the same name with a copy of the .xml file in it.
this is the code that i have so far:
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import java.io.File;
public class FileCopy{
public static void copyFile(Document source, Document target)
Node node = target.importNode(source.getDocumentElement(), true);
target.getDocumentElement().appendChild(node);
static void report(boolean b){
     System.out.println(b ? "success" : "failure");
public static void main(String args[]){
     boolean status;
     status = new File("/project1").mkdirs();
     report(status);
some of my questions are:
A) how do i copy the exact name of the folder / .xml file?
B) how do i even create a new blank .xml file for which i can use copyFile to copy over? (note it needs both a source and a target)
C) how do i find the .xml file in the folder in which he gave me?
Any help is appreciated

rzhang10 wrote:
Okay, but how do I ensure that the file I copied will be a .xml file?Mixing up of tenses leading to ambiguity! Bottom line: if it was XML, and you copy it, it will be XML.
here is a copyFile function I found on the web:
public static void copyFile(File in, File out) throws IOException{
          FileChannel inChannel = new FileInputStream(in).getChannel();
          FileChannel outChannel = new FileOutputStream(out).getChannel();
          try{
               inChannel.transferTo(0 , inChannel.size(), outChannel);
          catch(IOException e){
               throw e;
          finally{
               if(inChannel != null) inChannel.close();
               if(outChannel != null) outChannel.close();
are you saying that this code would be sufficient to copy an .xml file? everytime I've tried it, it reproduces a .txt file.An XML file is a text file.

Similar Messages

  • Help with Project Management setup from very basics...

    hi all!
    i am new to e-business suite and now i have installed vision demo database successfully on a Quad Core with 320 GB hard and 4 GB ram...now i need help to setup Project Management (PM) module for a hypothetical construction company with the required functionalities (just limited functionalities and Not complete functionalities as in EBS).i need help in setting up Project Management module from the very basics...so can you help me out in this...thanks in anticipation

    Hi,
    Please post only once (do not post same thread across multiple forums).
    help with Financials setup from very basics...
    Re: help with Financials setup from very basics...
    Regards,
    Hussein

  • Need help with Project Pro

    Hi,
    I recently purchased few licenses for Project pro from office 365 (online version). When I log in to office 365 and go to my apps I can not see Project Pro app there? Where it might be?
    Also when I create a project with desktop app, where is the option to sync that project to server? The license already included with
    Project Online and Project server Sync.
    Any Help solving my issues will be greatly appreciated.
    Thanks in advance..

    Hi,
    Please see this
    article for starting a project with Project Pro for Project Online.
    Don't forget to use in Project Pro the email adress used for creating your O365 account.
    Hope this helps,
    Guillaume Rouyre, MBA, MVP, P-Seller |

  • Help with project/folder setup for new flex project??

    Hello all,
      I need help deciding how to set up my projects for a new flex application we're developing.
    We have an in-house custom java/jsp "framework". This framework has JSP pages for administering applications that are built using this framework. One part of the framework generates all java base and model objects from our database tables to be used in the new application.
    The new application will have a back-office part (Adobe AIR) and a web facing part (Adobe Flex).  Both the AIR and Flex parts of the application need to access the java model objects via AS3 classes (I believe I'll do this using remoteobject).
    My questions are as follows:
    After I create the base and model AS3 classes that remoteobject with the java classes can I put these in a common library project so both my AIR and Flex app can access common AS3 code.  I feel I should do this to keep from duplicating code by copying the AS3 classes in both my AIR and Flex projects.  Can you give my any examples or links to information on how to do this??
    I plan to also create a common java project for all base and model objects generated from my db tables so that the common library project with AS3 classes could remoteobject interface with the java classes in the java project. I would like to keep all of my business logic in the java model classes.  Does this seem appropriate for the projects/setup listed above?
    Here are the projects I think I need in Flex Builder.
    FlexWebApp
    AIRBackOfficeApp
    JavaApp - Common
    AS3FlexLibraryApp - Common
    The FlexWebApp and AIRBackOfficeApp will reference the AS3FlexLibraryApp and the AS3FlexLibraryApp will remoteobject to the java classes in JavaApp.
    Any help or direction with this is greatly appreciated.
    Thanks,
    Whitney

    Hi,
    Please post only once (do not post same thread across multiple forums).
    help with Financials setup from very basics...
    Re: help with Financials setup from very basics...
    Regards,
    Hussein

  • Need help with project

    Hi all I'm working on a project and need help.
    I want the "New" button to clear all the fields.
    Any help?
    =======================================================
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class Message extends JFrame implements ActionListener {
         public Message() {
         super("Write a Message - by Kieran Hannigan");
         setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
         setSize(370,270);
         FlowLayout flo = new FlowLayout(FlowLayout.RIGHT);
         setLayout(flo);
         //Make the bar
         JMenuBar bar = new JMenuBar();
         //Make "File" on Menu
         JMenu File = new JMenu("File");
         JMenuItem f1 = new JMenuItem("New");
         JMenuItem f2 = new JMenuItem("Open");
         JMenuItem f3 = new JMenuItem("Save");
         JMenuItem f4 = new JMenuItem("Save As");
         JMenuItem f5 = new JMenuItem("Exit");
         File.add(f1);
         File.add(f2);
         File.add(f3);
         File.add(f4);
         File.add(f5);
         bar.add(File);
         //Make "Edit" on menu
         JMenu Edit = new JMenu("Edit");
         JMenuItem e1 = new JMenuItem("Cut");
         JMenuItem e2 = new JMenuItem("Paste");
         JMenuItem e3 = new JMenuItem("Copy");
         JMenuItem e4 = new JMenuItem("Repeat");
         JMenuItem e5 = new JMenuItem("Undo");
         Edit.add(e5);
         Edit.add(e4);
         Edit.add(e1);
         Edit.add(e3);
         Edit.add(e2);
         bar.add(Edit);
         //Make "View" on menu
         JMenu View = new JMenu("View");
         JMenuItem v1 = new JMenuItem("Bold");
         JMenuItem v2 = new JMenuItem("Italic");
         JMenuItem v3 = new JMenuItem("Normal");
         JMenuItem v4 = new JMenuItem("Bold-Italic");
         View.add(v1);
         View.add(v2);
         View.add(v3);
         View.addSeparator();
         View.add(v4);
         bar.add(View);
         //Make "Help" on menu
         JMenu Help = new JMenu("Help");
         JMenuItem h1 = new JMenuItem("Help Online");
         JMenuItem h2 = new JMenuItem("E-mail Programmer");
         Help.add(h1);
         Help.add(h2);
         bar.add(Help);
         setJMenuBar(bar);
         //Make Contents of window.
         //Make "Subject" text field
         JPanel row2 = new JPanel();
         JLabel sublabel = new JLabel("Subject:");
         row2.add(sublabel);
         JTextField text2 = new JTextField("RE:",24);
         row2.add(text2);
         //Make "To" text field
         JPanel row1 = new JPanel();
         JLabel tolabel = new JLabel("To:");
         row1.add(tolabel);
         JTextField text1 = new JTextField(24);
         row1.add(text1);
         //Make "Message" text area
         JPanel row3 = new JPanel();
         JLabel Meslabel = new JLabel("Message:");
         row3.add(Meslabel);
         JTextArea text3 = new JTextArea(6,22);
         messagearea.setLineWrap(true);
         messagearea.setWrapStyleWord(true);
         JScrollPane scroll = new JScrollPane(text3,
                                  JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,
                                  JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
         row3.add(scroll);
         add(row1);
         add(row2);
         add(row3);
         setVisible(true);
         public static void main(String[] arguments)  {
         Message Message = new Message();
    }

    Ok, given that I may have not been the kindest to you on the other thread (and I'm still annoyed that you went and cross-posted this), and that you did actually use code tags, I'm going to post some code here:
    Please take the following advice onboard though.
    1. When you are naming your artifacts, please use the java coding standard as your guide. So if you are naming a class you use a capital letter first, and use camel case thereafter. All method names begin with a lower case letter, and all variable names begin with a lower case letter (and again camel case after that)
    2. Please use self explanitory names (for everything), so no more row1, row2, or text1, text2, etc.
    3. The example I am giving below makes use of a single class to handle all actions, this is not really the best way to do this, and a better way would be to have a class to handle each action (that would remove the massive if() else if() in the action handler class.
    4. When you are using class variables they should be private (no exceptions, ever!), if you need to access them from other classes use accessors (eclipse and other IDE tools can generate these methods for you in seconds)
    5. Notice the naming convention for my constants (final statics), they are all upper case (again from the java coding standards document, which you are going to look for with google right?)
    6. I have hived some of the creation work to helper methods (the getSubjectTextField() etc), although it isn't advisable to be calling other methods from the constructor, since this is a GUI, and you want it to appear as soon as you create the class, we won't worry about this, but perhaps as an execrise you could work out a better way to do this?
    7. Personally, I don't like classes that implement listeners, unless they are specifically designed to do that job. So a Frame that is set up as an action listener is fine, provided the actions it listens for are associated with the frame, not its contents. If the actions are related to its contents, then a dedicated class is better.
    8. Another personal opinion, but I feel it makes code clearer, but others may disagree. If you are creating a variable solely to hold the result of a calculation, to be passed to a method in the very next line, then don't create the variable, just pass the method as the argument to the method (feel free to ignore this advice if the method call is extremely long, and a local would make it easier to read)
    Anyway, here is the code. I have removed most of the menu items, and leave this as an exercise for you. Also I have only created 2 methods (new and exit), I'll again leave it as an exercise for you to complete this.
    package jdc;
    import java.awt.FlowLayout;
    import java.awt.event.ActionEvent;
    import javax.swing.AbstractAction;
    import javax.swing.JFrame;
    import javax.swing.JLabel;
    import javax.swing.JMenu;
    import javax.swing.JMenuBar;
    import javax.swing.JMenuItem;
    import javax.swing.JOptionPane;
    import javax.swing.JPanel;
    import javax.swing.JScrollPane;
    import javax.swing.JTextArea;
    import javax.swing.JTextField;
    import javax.swing.ScrollPaneConstants;
    public class Message extends JFrame {
        /** Constant for the new action command. */
        private static final String NEW_COMMAND = "New";
        /** Constant for the exit action command. */
        private static final String EXIT_COMMAND = "Exit";
        /** Subject text field. */
        private JTextField subjectTextField;
        /** Recipient text field. */
        private JTextField toTextField;
        /** Message text area. */
        private JTextArea messageTextArea;
        public Message() {
            super("Write a Message - by Kieran Hannigan");
            setSize(370, 270);
            FlowLayout flo = new FlowLayout(FlowLayout.RIGHT);
            setLayout(flo);
            setJMenuBar(createMenuBar());
            // Add "Subject" text field
            JPanel subjectRow = new JPanel();
            subjectRow.add(new JLabel("Subject:"));
            subjectRow.add(getSubjectTextField());
            // Add "To" text field
            JPanel toRow = new JPanel();
            toRow.add(new JLabel("To:"));
            toRow.add(getToTextField());
            // Make "Message" text area
            JPanel messageRow = new JPanel();
            JScrollPane scroll = new JScrollPane(getMessageTextArea(), ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS,
                    ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
            messageRow.add(scroll);
            add(toRow);
            add(subjectRow);
            add(messageRow);
            setVisible(true);
         * Clear all the fields.
        public void createNewMessage() {
            getSubjectTextField().setText("");
            getToTextField().setText("");
            getMessageTextArea().setText("");
         * Exit the application.
        public void exitApplication() {
            if (JOptionPane.showConfirmDialog(this, "Are you sure you would like to exit now?", "Exit",
                    JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION) {
                System.exit(0);
         * @return The subject text field, (creates a new one if it doesn't already exist)
        private JTextField getSubjectTextField() {
            if (this.subjectTextField == null) {
                this.subjectTextField = new JTextField("RE:", 24);
            return this.subjectTextField;
         * @return The to text field, (creates a new one if it doesn't already exist)
        private JTextField getToTextField() {
            if (this.toTextField == null) {
                this.toTextField = new JTextField(24);
            return this.toTextField;
         * @return The message text area, (creates a new one if it doesn't already exist
        private JTextArea getMessageTextArea() {
            if (this.messageTextArea == null) {
                this.messageTextArea = new JTextArea(6, 22);
                this.messageTextArea.setLineWrap(true);
                this.messageTextArea.setWrapStyleWord(true);
            return this.messageTextArea;
         * Helper method to create the menu bar.
         * @return Menu bar with all menus and menu items added
        private JMenuBar createMenuBar() {
            JMenuBar bar = new JMenuBar();
            JMenu fileMenu = new JMenu("File");
            fileMenu.add(new JMenuItem(new MenuItemAction(this, NEW_COMMAND)));
            fileMenu.add(new JMenuItem(new MenuItemAction(this, EXIT_COMMAND)));
            bar.add(fileMenu);
            // TODO add all other menu's and menu items here....
            return bar;
         * Private static class to handle all menu item actions.
        private static class MenuItemAction extends AbstractAction {
            /** Instance of the message class. */
            private Message message;
             * @param actionName
            public MenuItemAction(Message messageFrame, String actionName) {
                super(actionName);
                this.message = messageFrame;
             * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
            public void actionPerformed(ActionEvent e) {
                if (e.getActionCommand().equals(NEW_COMMAND)) {
                    this.message.createNewMessage();
                } else if (e.getActionCommand().equals(EXIT_COMMAND)) {
                    this.message.exitApplication();
                // TODO Add the other event handlers here
        public static void main(String[] arguments) {
            Message messageFrame = new Message();
            messageFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    }If you have any questions, please let me know, as there are a number of new areas introduced that you may not have come across before.

  • Help with project...

    I have aproject to do in my cs class. I seriously do not know what to do here:
    "For this project you will write a program that will aid in the cracking of a substitution cipher. Basically, it is a form of frequency analysis. Your program will read in a String as input from the user and count the number of times each letter appears in the String. It will then print out the frequency of each letter, along with a decimal frequency or percentage (your choice). You must use an array for this program - you will be severely penalized for not using an array. After running your program your output may look something like this:
    Welcome to Letter Frequency Analyzer v. 1.0
    Enter a String to be analyzed: The quick brown fox jumps over the lazy dog.
    Letter Frequencies
    ==================
    A12.86%
    B12.86%
    C12.86%
    D12.86%
    E38.57%
    F12.86%
    G12.86%
    H25.71%
    I12.86%
    J12.86%
    K12.86%
    L12.86%
    M12.86%
    N12.86%
    O411.43%
    P12.86%
    Q12.86%
    R25.71%
    S12.86%
    T25.71%
    U25.71%
    V12.86%
    W12.86%
    X12.86%
    Y12.86%
    Z12.86%
    How does this help crack a substitution cipher? By using the letter frequencies of letters in the English language, we can make educated guesses about which letters are substituted for the most common letters (ie. the most common would be e, the next most common would be t, etc). This, of course, would not work for some ciphertexts (like the one in the example), but it should work for most of the cryptogram puzzles that you find in the newspaper.
    Hints: Your array should contain 26 elements that you will store the frequency of each letter. The main part of your program will first convert the input String to uppercase, and then use a for loop to go through each letter of the String, incrementing the appropriate index in the array. You do not need a 26 case switch statement to do this! You can cleverly use casting and the unicode values of each letter (see the appendix in your book) to index into the array. My version of this program (that produced the output above) was only 31 lines of code (including 3 blank lines, 5 lines with only brackets, the class and main method definitions, an import statement, etc - in other words, I wrote it just like I write any other program). If you can keep the number of lines in your program at or below 45 (and maintain good coding style), you will receive a 10 point bonus for this project! (the 45 lines do not include the normal 5 line header required at the top of all source code submissions)"
    Wtf mate??
    Your help is greatly appreciated!
    Steve

    One of the unwritten rules of this forum is that we don't do other people's homework. But I will give you a hint:
    You can cast a character to an integer, if you do you get its unicode value as a number A is \u0041 (in hexadecimal), so the number you get is 65. B is 66, Z is 90.

  • Help with project: trying to create variables from decimals

    topic may be a bit unclear, but I have a project from a java course. I need to create a simple program, but hit a bit of a bump.
    I have made a formula to find that the total hours equals 2.7350 which is equal to 2hours, 44minutes, 6seconds.
    so to sum what I just said up, I have the number 2.7350, but need to display 2hours, 44minutes, 6seconds
    now I need help of how I can accomplish this with basic java (this is my first java class).
    If there is a way to leave 2 and take .7350 in separate variables, I can make some more formulas to convert that to the answer I need displayed, but I don't know how.
    Please help if you have ideas
    Thank You

    ahh, that just gave me an idea, I can't believe subtraction didn't come into my mind.
    I also should have mentioned that the numbers are generated via formula and user input, so it is not pre set.
    I will try something out with the subtraction idea. however, if you have a solution please post it in case my idea doesn't work.
    thanks again ^^

  • Need help with project (calling methods) please!!

    Hi there i have a project for uni requiring me to create a java program that creates a random No. and lets the user have three guesses to find the No. When the users guesses correct he gets a message telling him hes won and if he doesnt get it correct he gets a message telling him the correct No then terminates.
    The code has to call an outside method called[b] Public Static Boolean CheckGuess
    I have tried to create this and got it to compile with no errors (eventually) but i keep getting a message saying i have whenever i type any number in. I think the problem is the way i am calling the method i havnt got much experience this is all pretty new to me any help would be really appreciated. Thanks.
    import javax.swing.*;
    import java.util.*;
    public class Coursework1{
         public static void main(String args[]){
              int randomnumber,usersguessint,checkguess,guessvalid,attempts;
              String usersguess,output;
              boolean match;
              //create random number generator
              Random numGenerator = new Random();
              //generate a random number between 1 & 10 inclusive
              randomnumber = Math.abs(numGenerator.nextInt(9))+1;
              //initialize variable attempts
              for ( attempts = 0; attempts < 3; attempts++ ) {
                   //ask user for his first guess
                   usersguess=JOptionPane.showInputDialog("Please enter your guess between 1 & 10");
                   //convert users guess to integer
                   usersguessint = Integer.parseInt(usersguess);
                        //validate input
                        while (usersguessint<1||usersguessint>10){
                        usersguess=JOptionPane.showInputDialog("You entered an incorrect number \nPlease enter a numberbetween 1 & 10");
                         //convert users guess to integer
                        usersguessint = Integer.parseInt(usersguess);
                        } //end while loop
                             //call boolean method
                             if (match=true){
                             //display text area in JoptionPane
                             output="You won";
                             JOptionPane.showMessageDialog(null,output,"You Won",JOptionPane.INFORMATION_MESSAGE);
                             break;}
                             else{
                             output="Try again";     
                             JOptionPane.showInputDialog("Try again");
                                  }     //end if
                   } //end for
              }//end main
                             //user defined method
                             public static boolean checkGuess(int usersguessint,int randomnumber){
                             boolean match = false;
                             if (usersguessint == randomnumber){
                             match = true;
                             return match;
                             }//end method
         }//endclass

    Thank you very much that worked a treat the program is working better now. I have just realised that my for loopcontaining my counter may be in the wrong place as the program is running though both messages 3 times e.g
    "Please enter your guess between 1 & 10"
    "Try again"
    "Please enter your guess between 1 & 10"
    "Try again"
    "Please enter your guess between 1 & 10"
    "Try again"
    "Please enter your guess between 1 & 10"
    "Try again"
    I want my program to run like
    "Please enter your guess between 1 & 10"
    "Try again"
    "Try again"
    "Try again"
    Do u think if i placed my for stament (counter) in between the two messages it would eliminate this problem.

  • Please help with project

    Hey there
    I have a project due soon and would like to add a Gui. Can anyone help me. I'll e-mail you the program. Ive done half the text but would like a GUi included and some tips from people that know what they are talking about.
    Thanks

    A good starting point is (after once doing it by hand to see how everything fits together), to use a dialog editor.
    For instance the NetBeans IDE has such a "form editor". Drag and drop your buttons and such.
    Add events "actionPerformed" to such buttons etcetera.
    It still is a time consuming task. So prepare yourself: think of the layout and rest of user-interface you want to achieve.

  • Help with project PLEASE

    does anyone have any suggestions on how to do the rest of this project
    import javax.swing.JOptionPane;
    public class Bank {
         private static char which;
         public static void main(String args[])
         Account[] bankAcct = new Account[30];
         int num = 0;
         Customer c = new Customer("Daffy", "Duck");
         Savings s = new Savings(c, 40000, 1237,3.00);
         Checking ck = new Checking(c, 3500, 1235,2.50);     
         bankAcct[0]=s;
         bankAcct[1]=ck;
         bankAcct[2] = new Checking ( new Customer("Bugs", "Bunny"), 2000,1236,4.00);
         num = 3;
    int ans=0;
    while (ans!=6)
    menu();
    System.out.println("CHOICE:");
    ans = Keyboard.readInt();
    if (ans==1)
    num = addAccount(bankAcct,num);
    if (ans==2)
    sortAccount(bankAcct,num);
    if (ans==3)
    process(bankAcct,num);
    if (ans == 4)
    printAll(bankAcct,num);
    if (ans==5)
         System.out.println("See ya later!!!!");
    System.exit(0);
         * Method addAccount.
         * @param bankAcct
         * @param num
         * @return int
         private static int addAccount(Account[] bankAcct, int num)
              return 0;
    public static void menu()
    System.out.println("1. Add an account");
    System.out.println("2. sort the accounts");
    System.out.println("3. end of month processing");
    System.out.println("4. print all records");
    System.out.println("5. exit");
    public static int addAccount(Account[] a, int num, String name)
         // ask for fields needed for an account
         JOptionPane.showInputDialog( "Enter Name" );
         JOptionPane.showInputDialog( "Enter Address" );
         JOptionPane.showInputDialog( "Enter Phone Number" );
         JOptionPane.showInputDialog( "Enter Date of Birth" );
         JOptionPane.showInputDialog( "Enter Social Security Number" );
         JOptionPane.showInputDialog( "Enter Account Number" );
         // declare local variables and store the information in these
         // ask whether it is a checking or savings. Read in a char datatype named which
         JOptionPane.showInputDialog("Enter checking or savings [C],[S]");
         if (which=='C')
              // ask for the monthly fee and read it into a variable
              // create an instance of a checking account and add it to the array
         else if (which=='S')
              // ask for the interest rate and read it into a variable
              // create an instance of a savings account and add it to the array
         return ++num;
    public static void sortAccount(Account[] a, int num)
    for(int pass = 1; pass < num; pass++)
    for(int pair = 1; pair < num; pair++)
    if(a[pair].compareTo(a[pair - 1]) < 1)
    Account temp = a[pair - 1];
    a[pair - 1] = a[pair];
    a[pair] = temp;
    public static void process(Account[] acct, int num)
         // use a for loop to calculate all the new balances
    public static void printAll(Account[] acct, int num)
         // use a for loop to print out all of the accounts
         * Returns the which.
         * @return char
         public static char getWhich()
              return which;
         * Sets the which.
         * @param which The which to set
         public static void setWhich(char which)
              Bank.which = which;

    I dont know how to do the code code comments that are listed
    // ask for fields needed for an account
    // declare local variables and store the information in these
    // ask whether it is a checking or savings. Read in a char datatype named which
    // ask for the monthly fee and read it into a variable
    // ask whether it is a checking or savings. Read in a char datatype named which
    // ask for the interest rate and read it into a variable
              // create an instance of a savings account and add it to the array
    public static void process(Account[] acct, int num)
         // use a for loop to calculate all the new balances
    public static void printAll(Account[] acct, int num)
         // use a for loop to print out all of the accounts
    public static int addAccount(Account[] a, int num, String name)
         // ask for fields needed for an account
         JOptionPane.showInputDialog( "Enter Name" );
         JOptionPane.showInputDialog( "Enter Address" );
         JOptionPane.showInputDialog( "Enter Phone Number" );
         JOptionPane.showInputDialog( "Enter Date of Birth" );
         JOptionPane.showInputDialog( "Enter Social Security Number" );
         JOptionPane.showInputDialog( "Enter Account Number" );
         // declare local variables and store the information in these
         // ask whether it is a checking or savings. Read in a char datatype named which
         JOptionPane.showInputDialog("Enter checking or savings 'C','S'");
         if (which=='C')
              // ask for the monthly fee and read it into a variable
         JOptionPane.showInputDialog("Enter monthly fee");
              // create an instance of a checking account and add it to the array
         else if (which=='S')
              // ask for the interest rate and read it into a variable
              // create an instance of a savings account and add it to the array
         return ++num;
    public static void sortAccount(Account[] a, int num)
    for(int pass = 1; pass < num; pass++)
    for(int pair = 1; pair < num; pair++)
    if(a[pair].compareTo(a[pair - 1]) < 1)
    Account temp = a[pair - 1];
    a[pair - 1] = a[pair];
    a[pair] = temp;
    public static void process(Account[] acct, int num)
         // use a for loop to calculate all the new balances
    public static void printAll(Account[] acct, int num)
         // use a for loop to print out all of the accounts

  • Help with project management, please?

    Hello all!
    It's been about a year since I've last visited this forum and I'm lost .. the format must have changed?
    Here's what I'm trying to remember (it was a simple task)
    I have a project that I would like to break into smaller segments for the sake of managing it.
    I recall having selected a portion of my project and either rendering it or exporting it to a file.
    There was also some "switch" that should be selected to maintain maximum resolution and no
    compression.
    When several portions are rendered/exported in this fashion, it becomes an easier task to
    pull the pieces into back into a time line for the sake a rendering the completed work to
    be burned onto a DVD.
    Does anyone remember how this process was done?  Was it "Render"?  "Export"?  What
    was the selection that maintains the hi-resolution?
    (I’m using Premiere Elements)
    Thank you!
    --Tom Nickel

    Hunt,
    Thank you copiously for the information!
    I had
    done this before, but I've forgotten how!
    Thanks again,
    --Tom Nickel
    Tom,
     
    Welcome to the "new & improved" Adobe forum. Don't
    worry, I've been around
    these for many more years, than my
    Profile indicates, and still cannot
    find my way around this new
    one.
     
    Now, the process that you
    describe is to create "mini-Projects," edit them
    >
    completely, and then Export to DV-AVI Type II files w/ 48KHz 16-bit
    PCM/WAV Audio. These can then be Imported into "master
    Project," and
    assembled into a final.
    >
     
    Just do your full editing, as things like
    Transitions will be part of the
    these DV-AVI's and to get rid
    of them, is a lot of work.
     
    Good luck,
     
    Hunt
    >

  • Need some help with project - help is VERY appreciated!

    This one has been driving me nuts for a few days. So basically, I have this constructor.
    public SportStacker( String newName, int numTimes, int newID )
             name = newName;
             numTimesRecorded = 0;
             times = new double[ numTimes ];
             ID = newID;
          }The important thing here being that it sets ID = newID. That's in the SportStacker class. We also have a method in SportStacker named getID:
    public int getID()
             return ID;
          }Okay, then we have another class, Contestant. In this class, we have an array of SportStacker objects. One method we had to create was to add a new contestant.
    public void addCompetitor(String name, int numTimesRecorded)
             if(numCompetitors == competitors.length)
                increaseSize();
             SportStacker temp = new SportStacker(name, numTimesRecorded, IDtracker);
             competitors[numTimesRecorded] = temp;
             numCompetitors++;
             IDtracker++;
    }Which I think is fine. However, the next one is addCompetitorTimes. It seems like it should be easy, but this part confuses me...in his instructions, he says: "This method should take in two parameters: an int representing the competitors ID and a double representing the time to be recorded. Then, search through competitors for the correct ID using the getID method provided in SportStacker..." This is what confuses me. One of the parameters taken in this method is the int representing his ID, and all getID will do is return what was last used in the constructor. It doesn't make any sense to me! Someone please help!

    johnboy8282 wrote:
    Minus the addTime part, just wanted to make sure I was doing this right first. Thanks so much for the help, your explanation helped me understand a lot!Using a for loop is clearer but yes your on the right track. Minor note, if the competitors array contains nulls then a runtime error will occur due to .getID() applied to a null object. This is easily avoidable.
    public void addCompetitorTimes(int compID, double timeToRecord){
      for(int i=0; i<numCompetitors; i++){
        if(competitors.getID() == compID){
    System.out.print("Add time stuff here...");
    break; //Break from for loop, no need to check other IDs
    }Mel                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Need help with Berkeley XML DB Performance

    We need help with maximizing performance of our use of Berkeley XML DB. I am filling most of the 29 part question as listed by Oracle's BDB team.
    Berkeley DB XML Performance Questionnaire
    1. Describe the Performance area that you are measuring? What is the
    current performance? What are your performance goals you hope to
    achieve?
    We are measuring the performance while loading a document during
    web application startup. It is currently taking 10-12 seconds when
    only one user is on the system. We are trying to do some testing to
    get the load time when several users are on the system.
    We would like the load time to be 5 seconds or less.
    2. What Berkeley DB XML Version? Any optional configuration flags
    specified? Are you running with any special patches? Please specify?
    dbxml 2.4.13. No special patches.
    3. What Berkeley DB Version? Any optional configuration flags
    specified? Are you running with any special patches? Please Specify.
    bdb 4.6.21. No special patches.
    4. Processor name, speed and chipset?
    Intel Xeon CPU 5150 2.66GHz
    5. Operating System and Version?
    Red Hat Enterprise Linux Relase 4 Update 6
    6. Disk Drive Type and speed?
    Don't have that information
    7. File System Type? (such as EXT2, NTFS, Reiser)
    EXT3
    8. Physical Memory Available?
    4GB
    9. Are you using Replication (HA) with Berkeley DB XML? If so, please
    describe the network you are using, and the number of Replica’s.
    No
    10. Are you using a Remote Filesystem (NFS) ? If so, for which
    Berkeley DB XML/DB files?
    No
    11. What type of mutexes do you have configured? Did you specify
    –with-mutex=? Specify what you find inn your config.log, search
    for db_cv_mutex?
    None. Did not specify -with-mutex during bdb compilation
    12. Which API are you using (C++, Java, Perl, PHP, Python, other) ?
    Which compiler and version?
    Java 1.5
    13. If you are using an Application Server or Web Server, please
    provide the name and version?
    Oracle Appication Server 10.1.3.4.0
    14. Please provide your exact Environment Configuration Flags (include
    anything specified in you DB_CONFIG file)
    Default.
    15. Please provide your Container Configuration Flags?
    final EnvironmentConfig envConf = new EnvironmentConfig();
    envConf.setAllowCreate(true); // If the environment does not
    // exist, create it.
    envConf.setInitializeCache(true); // Turn on the shared memory
    // region.
    envConf.setInitializeLocking(true); // Turn on the locking subsystem.
    envConf.setInitializeLogging(true); // Turn on the logging subsystem.
    envConf.setTransactional(true); // Turn on the transactional
    // subsystem.
    envConf.setLockDetectMode(LockDetectMode.MINWRITE);
    envConf.setThreaded(true);
    envConf.setErrorStream(System.err);
    envConf.setCacheSize(1024*1024*64);
    envConf.setMaxLockers(2000);
    envConf.setMaxLocks(2000);
    envConf.setMaxLockObjects(2000);
    envConf.setTxnMaxActive(200);
    envConf.setTxnWriteNoSync(true);
    envConf.setMaxMutexes(40000);
    16. How many XML Containers do you have? For each one please specify:
    One.
    1. The Container Configuration Flags
              XmlContainerConfig xmlContainerConfig = new XmlContainerConfig();
              xmlContainerConfig.setTransactional(true);
    xmlContainerConfig.setIndexNodes(true);
    xmlContainerConfig.setReadUncommitted(true);
    2. How many documents?
    Everytime the user logs in, the current xml document is loaded from
    a oracle database table and put it in the Berkeley XML DB.
    The documents get deleted from XML DB when the Oracle application
    server container is stopped.
    The number of documents should start with zero initially and it
    will grow with every login.
    3. What type (node or wholedoc)?
    Node
    4. Please indicate the minimum, maximum and average size of
    documents?
    The minimum is about 2MB and the maximum could 20MB. The average
    mostly about 5MB.
    5. Are you using document data? If so please describe how?
    We are using document data only to save changes made
    to the application data in a web application. The final save goes
    to the relational database. Berkeley XML DB is just used to store
    temporary data since going to the relational database for each change
    will cause severe performance issues.
    17. Please describe the shape of one of your typical documents? Please
    do this by sending us a skeleton XML document.
    Due to the sensitive nature of the data, I can provide XML schema instead.
    18. What is the rate of document insertion/update required or
    expected? Are you doing partial node updates (via XmlModify) or
    replacing the document?
    The document is inserted during user login. Any change made to the application
    data grid or other data components gets saved in Berkeley DB. We also have
    an automatic save every two minutes. The final save from the application
    gets saved in a relational database.
    19. What is the query rate required/expected?
    Users will not be entering data rapidly. There will be lot of think time
    before the users enter/modify data in the web application. This is a pilot
    project but when we go live with this application, we will expect 25 users
    at the same time.
    20. XQuery -- supply some sample queries
    1. Please provide the Query Plan
    2. Are you using DBXML_INDEX_NODES?
    Yes.
    3. Display the indices you have defined for the specific query.
         XmlIndexSpecification spec = container.getIndexSpecification();
         // ids
         spec.addIndex("", "id", XmlIndexSpecification.PATH_NODE | XmlIndexSpecification.NODE_ATTRIBUTE | XmlIndexSpecification.KEY_EQUALITY, XmlValue.STRING);
         spec.addIndex("", "idref", XmlIndexSpecification.PATH_NODE | XmlIndexSpecification.NODE_ATTRIBUTE | XmlIndexSpecification.KEY_EQUALITY, XmlValue.STRING);
         // index to cover AttributeValue/Description
         spec.addIndex("", "Description", XmlIndexSpecification.PATH_EDGE | XmlIndexSpecification.NODE_ELEMENT | XmlIndexSpecification.KEY_SUBSTRING, XmlValue.STRING);
         // cover AttributeValue/@value
         spec.addIndex("", "value", XmlIndexSpecification.PATH_EDGE | XmlIndexSpecification.NODE_ATTRIBUTE | XmlIndexSpecification.KEY_EQUALITY, XmlValue.STRING);
         // item attribute values
         spec.addIndex("", "type", XmlIndexSpecification.PATH_EDGE | XmlIndexSpecification.NODE_ATTRIBUTE | XmlIndexSpecification.KEY_EQUALITY, XmlValue.STRING);
         // default index
         spec.addDefaultIndex(XmlIndexSpecification.PATH_NODE | XmlIndexSpecification.NODE_ELEMENT | XmlIndexSpecification.KEY_EQUALITY, XmlValue.STRING);
         spec.addDefaultIndex(XmlIndexSpecification.PATH_NODE | XmlIndexSpecification.NODE_ATTRIBUTE | XmlIndexSpecification.KEY_EQUALITY, XmlValue.STRING);
         // save the spec to the container
         XmlUpdateContext uc = xmlManager.createUpdateContext();
         container.setIndexSpecification(spec, uc);
    4. If this is a large query, please consider sending a smaller
    query (and query plan) that demonstrates the problem.
    21. Are you running with Transactions? If so please provide any
    transactions flags you specify with any API calls.
    Yes. READ_UNCOMMITED in some and READ_COMMITTED in other transactions.
    22. If your application is transactional, are your log files stored on
    the same disk as your containers/databases?
    Yes.
    23. Do you use AUTO_COMMIT?
         No.
    24. Please list any non-transactional operations performed?
    No.
    25. How many threads of control are running? How many threads in read
    only mode? How many threads are updating?
    We use Berkeley XML DB within the context of a struts web application.
    Each user logged into the web application will be running a bdb transactoin
    within the context of a struts action thread.
    26. Please include a paragraph describing the performance measurements
    you have made. Please specifically list any Berkeley DB operations
    where the performance is currently insufficient.
    We are clocking 10-12 seconds of loading a document from dbd when
    five users are on the system.
    getContainer().getDocument(documentName);
    27. What performance level do you hope to achieve?
    We would like to get less than 5 seconds when 25 users are on the system.
    28. Please send us the output of the following db_stat utility commands
    after your application has been running under "normal" load for some
    period of time:
    % db_stat -h database environment -c
    % db_stat -h database environment -l
    % db_stat -h database environment -m
    % db_stat -h database environment -r
    % db_stat -h database environment -t
    (These commands require the db_stat utility access a shared database
    environment. If your application has a private environment, please
    remove the DB_PRIVATE flag used when the environment is created, so
    you can obtain these measurements. If removing the DB_PRIVATE flag
    is not possible, let us know and we can discuss alternatives with
    you.)
    If your application has periods of "good" and "bad" performance,
    please run the above list of commands several times, during both
    good and bad periods, and additionally specify the -Z flags (so
    the output of each command isn't cumulative).
    When possible, please run basic system performance reporting tools
    during the time you are measuring the application's performance.
    For example, on UNIX systems, the vmstat and iostat utilities are
    good choices.
    Will give this information soon.
    29. Are there any other significant applications running on this
    system? Are you using Berkeley DB outside of Berkeley DB XML?
    Please describe the application?
    No to the first two questions.
    The web application is an online review of test questions. The users
    login and then review the items one by one. The relational database
    holds the data in xml. During application load, the application
    retrieves the xml and then saves it to bdb. While the user
    is making changes to the data in the application, it writes those
    changes to bdb. Finally when the user hits the SAVE button, the data
    gets saved to the relational database. We also have an automatic save
    every two minues, which saves bdb xml data and saves it to relational
    database.
    Thanks,
    Madhav
    [email protected]

    Could it be that you simply do not have set up indexes to support your query? If so, you could do some basic testing using the dbxml shell:
    milu@colinux:~/xpg > dbxml -h ~/dbenv
    Joined existing environment
    dbxml> setverbose 7 2
    dbxml> open tv.dbxml
    dbxml> listIndexes
    dbxml> query     { collection()[//@date-tip]/*[@chID = ('ard','zdf')] (: example :) }
    dbxml> queryplan { collection()[//@date-tip]/*[@chID = ('ard','zdf')] (: example :) }Verbosity will make the engine display some (rather cryptic) information on index usage. I can't remember where the output is explained; my feeling is that "V(...)" means the index is being used (which is good), but that observation may not be accurate. Note that some details in the setVerbose command could differ, as I'm using 2.4.16 while you're using 2.4.13.
    Also, take a look at the query plan. You can post it here and some people will be able to diagnose it.
    Michael Ludwig

  • Need help with almost completed plugin engine project

    Hi all,
    For a while now I have been working on a plugin engine. After a few iterations, the engine is similar to the Eclipse engine, in that plugins use extension points and extensions to allow contributions. Unlike the eclipse engine I have added the ability for plugins to fire events through the engine and other plugins can add listeners, all through the plugin.xml manifest. Dependencies are mostly handled automatically at plugin load time (when extensions get resolved to extension points, and listeners get resolved to events). For the case where a plugin needs to use classes from another plugin, dependencies are also allowed to be declared. Like the eclipse engine, activation of plugins occurs the first time a class is used within the plugin's classpath, OR a plugin can be activated after it is loaded.
    What I need help with is testing, working on examples to provide with the engine project, and feedback/suggestions before we release the M1 build. I am asking for those that are interested in this type of work to volunteer to help where applicable and possible. I want to provide a solid plugin engine to the java community, one that is easy to use, works well, and is pretty effecient in terms of resource usage and performance.
    Of particular interest to me right at the moment is dealing with multiple versions. As I see it, the engine will be used within an application and as such plugins would be distributed with a specific application version. The plugin version itself is more of a notification as to what version a plugin is, although I imagine it will help when updating at runtime as well.
    Just a few other details of the engine. It handles (or will soon) dynamic load, unload and reload of plugins at runtime. Plugins can be distributed in an archive file format, we call .par (Plugin ARchive), with additional plugin filename extensions configurable at runtime. The plugins can be developed and deployed in an expanded directory format as they are in Eclipse as well, or in the archive format. In the archive format they do not need to be unzipped when deployed, and they can contain embeded jar/zip libraries. The engine handles finding and creating classes directly out of the .par file at runtime.
    Multiple locations to find plugins are configurable before the engine starts, and even after it starts more could be added to allow additional locations to find plugins. URLs are supported, and soon the HTTP protocol will be supported so that plugins can be downloaded and installed at runtime.
    The project can be found at www.sourceforge.net/projects/genpluginengine. If you would like to get involved and help out, please sign up on the dev mail list and send an email to introduce yourself to the rest of the members on the list.
    I'll also add that I am working on a Swing UI Framework built entirely from plugins. It provides a ready-to-launce UI application that developers can simply add their plugins to, extending various extension points of the framework to have menu items, toolbar buttons, status bar access, help and preferences dialog additions, file i/o choosers, tons of open-source components ready to use (or extend to add on to), and like Eclipse, hopefully... draggable window frames that can be dropped on any other frame to form a tabbed frame of windows. Some of this is a ways off, some is getting there now. Presently you can add menu items that do allow plugin activation when first clicked, so plugins can be loaded but not activated until needed. The Preference dialog works but is not completed, and a plugin that adds a plugin control panel to view all loaded plugins, activate them, load/unload/reload, view extension points, extensions, dependencies, etc is partially completed. The point is, to allow a ready to run UI framework in Swing with an easy path for developers to quickly build applications with. If you are interested in this, when you join the mail list and introduce yourself, indicate that you are interested in this as well, as we need help with plugin development for it and would appreciate more help here too.
    Look forward to some replies.

    Might I suggest setting up a project at a known project-site? I've seen your progress and questions posted here from time to time, but one of the drawbacks is that you have to fill each post with the entirity of your vision to explain what you're doing. That's a lot of text to read - and most folks will skip right over it.
    On the other hand, a well-crafted, good-looking project web-site, with appropriate links and docs and vision statements, diagrams, etc. will have more likelyhood of attracting volunteers. java.net and sourceforge.net are likely spots to set up shop. In addition, you get CVS and bug-tracking systems, which can be quite valuable in such a large-scale project where there are lots of pieces.

  • Help with Flex Ant build.xml error

    So I've started on a new project and I'm new to Flex. A lot of learning curve here. Anyway, I'm trying to deploy a project that uses flex and is built with Ant. We've moving up from a version of Flex 2 to Flex 3. The build file works fine in the Flex 2 app but for some reason does not seem to be working with Flex 3. I'm hoping someone can give me some insight on what might be wrong or where to start.
    The error is Command not found: compc
    The part of the build file it has a problem with is:
    <compc include-classes="${classes}"
         ouput="${flex.dist.dir}/${flex.app.name}.swc"
         keep-generated-actionscript="false"
         headless-server="${headless.server}"
         incremental="true">
    <load_config filename="${FLEX_HOME}/frameworks/flex-config.xml" />
    <source-path path-element="${FLEX_HOME}/frameworks" />
    <source-path path-element="${flex.app.root}" />
    <compiler.library-path dir="${FLEX_HOME}/frameworks" append="true">
         <include name="libs" />
         <include name="../bundles/{local}" />
    </compiler.library-path>
    <compiler.library-path dir="${flex.app.root}" appent="true">
         <include name="libs" />
    </compiler.library-path>
    </compc>
    Any help at all would be greatly appreciated, thank you.

    Sorry, I meant to address that. Yes, since we've moved up to the Flex 3 sdk, we are pointing at a new directory. The old directory was flex_sdk and the new directory is flex_sdk_340.
    FLEX_HOME is being set in the build.properties file for local building and then overidden in the build.xml file with this code:
    <target name="build">
         <available property="FLEX_HOME" value="/apps/flex_sdk_340" file="/apps/flex_sdk_340" />
         <echo>FLEX_HOME = ${FLEX_HOME}</echo>
         <antcall target="compile" />
    </target>
    I did notice a warning about not using the available property, so I removed it and just changed what FLEX_HOME was set to in the build.properties file to the server directory. Would mess up local building but regardless it didn't matter because it had no effect on the error being generated. I alos looked a little into the file property of the available tag trying to figure out if that was somehow an issue but I wasn't able to come to any conclusion.
    Before the program errors out, it does displayt he echo statement and the value of FLEX_HOME appears to be correct in that it does show /apps/flex_sdk_340.
    Thank you so much for your continued help. This is truly frustrating because nothing but a directory name has really changed and yet it stopped working. I can't find any information anywhere on what could be wrong and this is really my last resort.

Maybe you are looking for

  • Any ideas on how to get my home button to work like it should?

    I have the third generation iPad and have been having intermittent problems with the home button.  The iPad seems to work just fine, but sometimes the home button doesn't do anything.  If I am in Safari and want to change to Mail, for example, the on

  • What is SAP's strategy for XSI (Express Shipping Interface)?

    We are investigating if we can use SAP XSI for parcel tracking with DHL. We like the idea of having an integrated tracking solution that we can call from SO, PO, delivery note and shipment. However, I found information on the internet related to XSI

  • Problem with two OC4J instances in Oracle 10g AS

    hi all, i am using windows XP(OS), Oracle 10g Application Server. when i create two instances of OC4j other than home instance, say instance1 and instance2 and deploy two different applications in two instances then i get "page not found" error. both

  • MAJOR Start-up Issues:  Can my imac be saved?

    Hello all- I sure hope someone can help me. I am really worried about the state of my imac. It is only ONE YEAR old and has always been maintained with the latest updates. Quick background: A few weeks ago, while in screensaver mode, I returned to my

  • J2ee server status stopped in one of application server

    Short Text J2ee server status stopped in one of application server Long Text Dear supprot, We have 3 application servers to our production server. App1 and App3 are working fine. when i am trying to start App2 J2ee server0 for the same server is gett