Need some urgent help with Java code...

Hello
i am taking a java class..beginner..and i am a dud at programming...
had a couple of questions ..how do make a program ignore negative
integer values,make it terminate when zero is entered instead of a number ,how should i calculate maximum minimum of integers..please help me..
thanks
damini

You got some good advice from Java_Jay.
Here is a snippet I keep handy for console input and output. It doesn't do your home work but gives you a working example of getting numbers from stdin:
import java.io.*;
public class DemoKeyboardInput {
     public static void main(String[] args) throws IOException {
          // open keyboard for input (call it 'stdin')
          BufferedReader stdin = new BufferedReader(new InputStreamReader(
                    System.in), 1);
          // get input from the keyboard
          System.out.print("Please enter your name: ");
          String name = stdin.readLine();
          System.out.print("Please enter your age: ");
          String s1 = stdin.readLine();
          System.out.print("Please enter the radius of a circle: ");
          String s2 = stdin.readLine();
          // perform conversions on input strings
          int age = Integer.parseInt(s1); // string to int
          double radius = Double.parseDouble(s2); // string to double
          // operate on data
          age++; // increment age
          double area = Math.PI * radius * radius; // compute circle area
          // output results
          System.out.println("Hello " + name);
          System.out.println("On your next birthday, you will be " + age
                    + " years old");
          System.out.println("Area of circle is " + area);
}

Similar Messages

  • Need some URGENT help with 3 DVD mastering issues PLEASE! :

    Hi there,
    Firstly, I am running DVD SP 3.0.2 on Mac OS 10.4.7 on a G5 Dual 2 GHz 3Gb Ram plenty of HD space...
    I am creating a DVD with: An intro sequence, a main menu, 4 sub menus, and 4 sections with around 12 chapters each.
    I am having some big problems, and a pretty stuck. I will lest them separately below, numbered. If you are able to help, please refer clearly to which number you are helping with. Any help is MUCH appreciated! Many thanks!!
    1. Each of the 5 menus (1 main, 4 sub) have a background video, and a separate audio track. I added the background videos by simply dragging them to the assests panel, then from there onto the menu editor window. They are created in FCP and are properly encoded. However, when I click the motion button, or use the simulator, the videos do not show up. The music plays, but all i see is plain black.
    What is going on?!?!?!
    2. I am really struggling with rollover buttons. I have custom created buttons, and I wand them to have a soft red glow around them when hovered over. HOW ON EARTH DO I ACTUALLY DO THIS??
    The buttons are in photoshop so can be exported with/without background/glow in any format.
    3. Is it possible, once I have got the above rollover working, to have an image to the right hand side of my buttons which changes with the the button rollover. i.e. hover over button 1, see image 1. hover over button 2, image changes to image 2.
    PLEASE PLEASE give any help you can, I have a deadline coming up and am quite stumped. Thanks again!!

    I am still having problems regarding issue Number 1. PLEASE ANYONE HELP?!
    Sorry, I'm not sure about the motion menus. I avoid those whenever possible. But you might click on the menu in the storyline tab (whatever it's called -- the hierarchical view with the disc, tracks, slideshows, etc.) and look at the properties and see if there's anything you have to enable specifically for motion. And be sure the motion button is on on the main display/preview area, but it sounds like you already know how that works.
    For your information, here is a screen grab of the menu I am trying to create:
    http://www.redhavoc.co.uk/stuff/menu.jpg
    I think it is obvious that when a button is hovered over, I want it to glow red, and the image to the right will change to match the respective button.
    IS THIS GOING TO BE POSSIBLE????
    Yes.
    First, your menus have to be layered menus. Unfortunately, there's no way to convert non-layered menus to layered menus, so if you already have non-layered, you'll have to just delete them and create new layered menus. The button (and menu item) to create a layered menu should be right by the normal new-menu item.
    Next, the graphical work is all in Photoshop.
    Side tip: You may already know this, but I found it's best to use 640x480 for the Photoshop document. When I do text and leave it as a text object in the Photoshop file, it resizes poorly in DVDSP. So this ends up being another 720x480 vs. 640x480 square/rectangular pixel conversion thing. DVDSP plays in the 640x480 world, at least as far as the designer can see. So I keep my images at 640x480, and it doesn't have to resize, and everything looks right.
    Moving on... Set up your basic background, the part that won't change (or will have other things covering it, like for your square image).
    Then put in all the buttons and images you'll be using, each part in a separate layer. This could have fifteen buttons (you have five buttons, and there can be three versions for each -- inactive, selected, and activated versions) and five or six square images (you said one for each button, and you might want a blank default if, say, you want to add a "back" button on the menu and want some blank or default image for the square when they're on the "back" button).
    Sometimes people don't bother with a separate "active" button state, but you usually want some visual feedback that they clicked the button. Also, I usually just build the default (unselected) button into the background; that's less hassle later on, and it will just draw the selected or activated buttons over that when the user is on that button.
    Line up all your buttons and images. All the square images lined up perfectly on top of each other, all the buttons in the right places (so you'll have three buttons stacked on top of each other in each spot). Give each layer a short but quickly recognizable name, and line them up in a consistent order. (button1-default, button1-selected, button1-active, button1-squarepicture, then button2-default, ... etc.) Photoshop and DVDSP don't care, but it makes it easier for you later.
    Note that earlier versions of DVDSP won't show Photoshop layer effects. (They handle layers, just not the effects, like inner glow, outer bezel, etc.) I don't remember when they changed this, but I think it was version 4.something. So if you're using that method to make your buttons glow, you may have to flatten each selected or active button layer, and you may even need to create a dummy blank layer underneath it first to give it something to flatten onto.
    Save the file as a standard Photoshop file (.psd). Drag the file onto your DVDSP layered menu and set it as the background.
    Now, in DVDSP, create all your buttons. Just drag boxes over/around the button pictures you have. Feel free to make them extra-big; users won't see the actual area you've selected, and bigger areas makes it easier for people to hit them if they're using a mouse on a computer to watch the DVD. You can point the buttons to their targets now if you want, and set the end jumps on the tracks if you want. (I tend to set the end jumps on the tracks so they automatically select the button for the next track.)
    Now's the fun part, since it will actually hook everything up and should be easy if your naming layer order were consistent. Click on the layered menu (in that hierarchical view) and look at the properties window. (Sorry I can't remember the technical names for all these windows; I'm doing this all from memory. So feel free to ask more questions if you can't find what I'm talking about.) One of the properties tabs should have a grid of checkboxes with a list of your layers. Make sure the background is checked for all of the states. Then check the layers you want to show for each button state, as well as the corresponding square image to show for each.
    Again, I'm doing this from memory, and I can't remember exactly how things are listed in that grid. But I remember it keeps your layers in the same order you put them in the Photoshop file and shows you those names, so it should make it easy to go down the list and check the right boxes.
    And another side tip: You can update the Photoshop file, but once you've put it in DVDSP, if you change the layer order, it will screw up the check boxes you checked. It always shows you the layer names correctly, but it keeps the checkboxes in DVDSP simply assigned to the layer number, so the fifth layer will keep the same checkboxes even if you juggle them so some other layer is now the fifth layer. So if you do juggle the layers in Photoshop, go back and fix the checkbox list in DVDSP.
    I put a sample Photoshop file based on yours in
    http://dan.black.org/layered-menu-sample.psd
    It's quick and dirty, but shows the layer layout, and you should be able to drop it on DVDSP to play with. (I also won't leave it there forever, maybe a few weeks, so anybody reading this in a month or more probably will get a 404 for that url.)
    Again, doing this from memory, so feel free to ask if anything doesn't work or doesn't make sense.
    G4/dual867   Mac OS X (10.4.5)   2GB/0.8TB

  • Need some urgent help with my (simple) Applet!

    Hello, I'm pretty new to Java and I am beginning to like it!
    I'm still verry much new to the language, but if you can help me you make me verry happy!
    Oke so I made an Applet where if you push on the button Omhoog, Omlaag, Links, Rechts, and Reset the ball (created with g.Oval in the methode paint) the ball should move above, down, left, right, and with reset it should go to the specified beginningpoint. The thing which I can't get to work is that when you push for instance on rechts(right) I want it to change in color for each specific movement (i.e left right...) and turn to black again when pushing on the reset button. I have been meshing around with if and else but I don't seem to know how to set this proparly. (I hope you can help me out!)
    this is my sourcecode:
    package oefening80;
    import java.awt.*;
    import java.awt.event.*;
    import java.applet.*;
    public class Applet1 extends Applet {
    int xPos = 130, yPos = 130;
    Button Omhoog, Omlaag, Links, Rechts, Reset;
    boolean geklikt, gekliktL;
    public void init() {
    setBackground( Color.yellow );
    setLayout( null );
    geklikt = false;
    Omhoog = new Button( "Omhoog" );
    Omhoog.addActionListener( new OmhoogHandler() );
    Omhoog.setBounds( 120, 20, 50, 20 );
    gekliktL = false;
    Omlaag = new Button( "Omlaag" );
    Omlaag.addActionListener( new OmlaagHandler() );
    Omlaag.setBounds( 120, 60, 50, 20 );
    Reset = new Button( "Reset" );
    Reset.addActionListener( new ResetHandler() );
    Reset.setBounds( 120, 40, 50, 20);
    Links = new Button( "Links" );
    Links.addActionListener( new LinksHandler() );
    Links.setBounds(70, 40, 50, 20 );
    Rechts = new Button( "Rechts" );
    Rechts.addActionListener( new RechtsHandler() );
    Rechts.setBounds( 170, 40, 50, 20 );
    add( Omhoog );
    add( Omlaag );
    add( Reset );
    add( Links );
    add( Rechts );
    public void paint( Graphics g ) {
    g.fillOval( xPos, yPos, 30, 30 );
    class OmhoogHandler implements ActionListener {
    public void actionPerformed( ActionEvent e ) {
    yPos -= 10;
    repaint();
    class OmlaagHandler implements ActionListener {
    public void actionPerformed( ActionEvent e ) {
    gekliktL = true;
    yPos += 10;
    repaint();
    class ResetHandler implements ActionListener {
    public void actionPerformed( ActionEvent e ) {
    xPos = 130;
    yPos = 130;
    repaint();
    class LinksHandler implements ActionListener {
    public void actionPerformed( ActionEvent e ) {
    xPos -= 10;
    repaint();
    class RechtsHandler implements ActionListener {
    public void actionPerformed( ActionEvent e ) {
    xPos += 10;
    repaint();
    thanks.

    Gotten tag.
    import java.awt.*;
    import java.awt.event.*;
    import java.applet.*;
    public class Applet1 extends Applet
         int     xPos = 130, yPos = 130;
         Button  Omhoog, Omlaag, Links, Rechts, Reset;
         boolean geklikt, gekliktL;
    public void init()
         setBackground( Color.yellow );
         setLayout( null );
         ActionListener actl = new OHandler();
         geklikt = false;
         Omhoog = new Button("Omhoog");
         Omhoog.addActionListener(actl);
         Omhoog.setBounds(115, 20, 60, 20 );
         gekliktL = false;
         Omlaag = new Button("Omlaag");
         Omlaag.addActionListener(actl);
         Omlaag.setBounds(115, 60, 60, 20 );
         Reset = new Button("Reset");
         Reset.addActionListener(actl);
         Reset.setBounds(120, 40, 50, 20);
         Links = new Button("Links");
         Links.addActionListener(actl);
         Links.setBounds(70, 40, 50, 20 );
         Rechts = new Button("Rechts");
         Rechts.addActionListener(actl);     
         Rechts.setBounds(170, 40, 50, 20 );
         add(Omhoog);
         add(Omlaag);
         add(Reset);
         add(Links);
         add(Rechts);
    public void paint(Graphics g)
         super.paint(g);
         g.fillOval(xPos, yPos, 30, 30 );
    class OHandler implements ActionListener
    public void actionPerformed(ActionEvent e)
         Object obj = e.getSource();
         if (obj.equals(Omhoog)) yPos -= 10;
         if (obj.equals(Omlaag)) yPos += 10;
         if (obj.equals(Rechts)) xPos += 10;
         if (obj.equals(Links))  xPos -= 10;
         if (obj.equals(Reset)) 
              xPos = 130;
              yPos = 130;
         repaint();
    [/code
    Noah                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Need some urgent help with ps vita

    My son has a ps vita, and a few days ago, I found some history of visiting adult websites. He claims that these sites just pop up, and he is not purposely seeking out these sites.
    Is it possible for adult sites to pop up on ps vitas?
    Thanks
    IW

    Sony PlayStation has a separate community which can be found here. Please visit the link for best assistance with your PlayStation Vita.
    If my post answers your question, please click on "Accept as Solution"

  • Need some urgent help on printing HTML

    I am trying to print an HTML using JEditorPane. I used all the GURU's views in this forum and copied the code. It works fine, but the images or not getting printed correctly
    Here is my HTML:
    <html>
    <head>
    <title>test</title>
    </head>
    <body>
    <h1>HELLO</h1>
    <h2>Hello</h2>
    <h6><big><big><big>This is a Test Program for the print</big></big></big></h6>
    <br>
    <p>
    You can also use an image as a link:
    <img border="0" src="D:\Tips\Projects\edib\logo.gif" width="65" height="38">
    </p>
    <br>
    <IMG SRC="D:\Tips\Projects\edib\logo.gif" width="65" height="38">
    </body>
    </html>
    These two images are not getting printed. My java class, html and logo.gif are all in the same directory.
    Here's the java code which I got it from this forum
    import java.io.*;
    import java.awt.print.*;
    import javax.swing.*;
    public class PrintHTMLSwing extends JFrame
         public static void main(String args[]) throws Exception
         //Read the HTML file to a String.
         FileInputStream fio = new FileInputStream(args[0]);
         int size = fio.available();
         byte[] fl = new byte[size];
         fio.read(fl,0,size);
         System.out.println(new String(fl));
         PrintableEditorPane ep = new PrintableEditorPane();
         ep.setContentType("text/html");
         //System.out.println(ep.getContentType());
         ep.setText(new String(fl));
         PrintHTMLSwing p = new PrintHTMLSwing();
         p.getContentPane().add(ep);
         //p.setSize(100,100);
         p.pack();
         p.show();
         // Get a PrinterJob
         PrinterJob job = PrinterJob.getPrinterJob();
         // Create a landscape page format
         PageFormat landscape = job.defaultPage();
         landscape.setOrientation(PageFormat.LANDSCAPE);
         // Set up a book
         Book bk = new Book();
         bk.append(ep, job.defaultPage());
         // Pass the book to the PrinterJob
         job.setPageable(bk);
         // Put up the dialog box
         if (job.printDialog())
              // Print the job if the user didn't cancel printing
              try
                   job.print();
              catch (Exception e)
                   System.out.println("Error 1:"+ e.toString());
              System.exit(1);
    class PrintableEditorPane extends javax.swing.JEditorPane implements java.awt.print.Printable
         public int print(java.awt.Graphics g, java.awt.print.PageFormat pageFormat, int      pageIndex)
              int x = (int)pageFormat.getImageableX();
              int y = (int)pageFormat.getImageableY();
              g.translate(x, y);
              paint(g);
              return PAGE_EXISTS;
    WILL ANYONE PLS HELP ME WHATS WRONG WITH THE CODE OR WHAT ELSE SHOULD I DO TO GET THE IMAGES TO PRINT CORRECTLY
    Thanks
    Tips

    All u need to do is specify a protocol. In your case it will be "file://"" preceeding the path to the images. Not a very good idea to use absolute path to the images though. Consider relative ones instead.
    Hope this helps.

  • Hi I have a geometry problem.Can anyone help with java code

    Hi I have a non simple polygon . My job is to make it a simple. for that First I need to find the intersecting lines say line AB intersects line CD. If so then I must replace AB & CD with AC & BD or AD or BC which ever keeps the polygon closed . So can anyone help me out with this code
    import java.io.*;
    import java.awt.*;
    import java.awt.geom.*;
    import java.awt.image.*;
    import javax.swing.*;
    public class Simple{
    static int POINTWID = 4; // size of points
    // the x and y arrays hold the coordinates
    // the B array is the order of the points in the polygon
    // You want to fill the C array with the simple polygon
    static double x[] = new double[200];
    static double y[] = new double[200];
    static int B[] = new int[200]; // the permutation matrix
    static int C[] = new int[200]; // the one that becomes simple
    static SimpleFrame myFrame;
    static int numPoints = 3;
    public static void main(String args[]) {
    makePolygons();
    // Create the frame to draw on
    myFrame = new SimpleFrame();
    myFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    myFrame.setSize(600, 600);
    myFrame.setVisible(true);
    public static void makePolygons(){
    // Build an array of random points in the unit square
    for(int i = 0; i < numPoints; i++){
    x[i] = Math.random();
    y[i] = Math.random();// Sample program
    B[i] = i; // default permutation
    // Create the simple polygon
    createSimplePolygon();
    * This is the only function you need to mess with
    public static void createSimplePolygon(){
    // Initialize the C[] array with the identity permutation
    for(int i = 0; i < numPoints; i++)
    C[i] = i;
    // Bubble sort the points from left to right
    for(int i = 0; i < numPoints; i++)
    for(int j = 0; j < numPoints - 1; j++)
    if(x[C[j]] > x[C[j+1]]){
    int temp = C[j];
    C[j] = C[j+1];
    C[j+1] = temp;
    public static class SimpleFrame extends JFrame{
    public static JSlider numPointsSlider;
    public SimpleFrame()
    super("Create you own Simple Polygon");
    Container content = getContentPane();
    content.setLayout(new java.awt.BorderLayout());
    JTabbedPane tabbedPane = new JTabbedPane();
    tabbedPane.setPreferredSize (new java.awt.Dimension(300, 400));
    tabbedPane.addTab("Scrambled", new ScrambledPanel());
    tabbedPane.addTab("Simple", new SimplePanel());
    content.add(tabbedPane, java.awt.BorderLayout.CENTER);
    // Slider for the number of points
    numPointsSlider = new JSlider (javax.swing.SwingConstants.HORIZONTAL,
    3, 100, 11);
    numPointsSlider.addChangeListener (new javax.swing.event.ChangeListener () {
    public void stateChanged (javax.swing.event.ChangeEvent evt) {
    numPointsSliderStateChanged (evt);
    content.add(numPointsSlider, java.awt.BorderLayout.SOUTH);
    private void numPointsSliderStateChanged (javax.swing.event.ChangeEvent evt) {
    numPoints = numPointsSlider.getValue();
    makePolygons();
    repaint();
    public static class ScrambledPanel extends JPanel{           
    public void paintComponent(Graphics g){
    super.paintComponent(g);
    Graphics2D g2 = (Graphics2D) g;
    // First set the scaling to fit the window
    Dimension size = getSize();
    int Xwid = (int) (0.95 * size.width);
    int Ywid = (int) (0.95 * size.height);
    // First draw the segments
    g2.setColor(Color.red);
    for(int i = 0; i < numPoints; i++)
    g2.drawLine((int) (Xwid * x[B[i]]),
    (int) (Ywid * y[B[i]]),
    (int) (Xwid * x[B[(i+1) % numPoints]]),
    (int)(Ywid * y[B[(i+1) % numPoints]]));
    // Now draw the points
    for(int i = 0; i < numPoints; i++){
    g2.fillRect((int) (Xwid * x) - POINTWID,
    (int) (Ywid * y[i]) - POINTWID,
    2*POINTWID + 1, 2*POINTWID + 1);
    public static class SimplePanel extends JPanel{
    public void paintComponent(Graphics g){
    super.paintComponent(g);
    Graphics2D g2 = (Graphics2D) g;
    // First set the scaling to fit the window
    Dimension size = getSize();
    int Xwid = (int) (0.95 * size.width);
    int Ywid = (int) (0.95 * size.height);
    // First draw the segments
    g2.setColor(Color.red);
    for(int i = 0; i < numPoints; i++)
    g2.drawLine((int) (Xwid * x[C[i]]),
    (int) (Ywid * y[C[i]]),
    (int) (Xwid * x[C[(i+1) % numPoints]]),
    (int)(Ywid * y[C[(i+1) % numPoints]]));
    // Now draw the points
    for(int i = 0; i < numPoints; i++){
    g2.fillRect((int) (Xwid * x[i]) - POINTWID,
    (int) (Ywid * y[i]) - POINTWID,
    2*POINTWID + 1, 2*POINTWID + 1);

    Hi I am sorry I could explain you properly . Ok
    My program gives me a polygon(as you can see when u
    run this program)But the polygon is a non simple
    polygon.So to make this polygon we must remove all
    the crossings betweeen edges in the polygon.The
    algorithm which i gave will remove all the crossings
    and make the polygon simple.You did not give an algorithm!
    SO my job is to take the
    existing code and implement the algorithm for this
    program in the Createsimpelpolygon() function. For
    this First the program must find whether two edges
    cross if they cross then swap the vertices like
    replace AB & CD with AC & BD or AD & BC.Which ever
    keeps the polygon closed . Still not entirely clear to me. You cannot just go and replace vertexes from a polygon: that way you'll end up with a different polygon.
    So as we go on we find the
    many crossings and iterate the algorithm on all the
    crossings until we get simple polygon.Like I said: I don't really understand what it is you're after. You did not respond to my suggestions, so I gather it is not what you're after?
    What about Polygon Tessellation (Google for it)? Perhaps that's what you want.
    Also, why do you not create a (or use java.awt's) Point class and a Polygon class which holds a java.util.Set of Point's? Your current code looks rather messy.

  • Need a DAC Expert - Need some Urgent Help DAC 10.1.3.4

    Hi We have just upograded out DAC from 7 to 10.1.3.4, We have upgraded the repository we were using in 7 to 10 via na empty container all the mappings look ok, we genereated the parameters, then build the execution plan.
    When we click execute we get the following error in the beginning about the w_param_g, it tries to carry on and then the mappings will fail because the w_param_g is empty, it's empty no rows in the w_param_g tables, the following error is displayed., we have tested the connections in the physical sources they all work as some of the mappings do run?, not sure what to try? anybody assist with anything please. Thanks
    START OF ETL
    1870 SEVERE Wed Dec 19 14:25:42 GMT 2012 Starting ETL Process.
    1871 SEVERE Wed Dec 19 14:25:42 GMT 2012
    ANOMALY INFO::: Error while getting database connection definition for node Update W_PARAM_G From DAC(->DataWarehouse)
    MESSAGE:::There is no database that match the description.
    EXCEPTION CLASS::: com.siebel.analytics.etl.execution.NoSuchDatabaseException
    com.siebel.analytics.etl.execution.DatabaseConnections.getByIdentifier(DatabaseConnections.java:131)
    com.siebel.analytics.etl.execution.DatabaseConnections.getPhysicalByIdentifier(DatabaseConnections.java:171)
    com.siebel.etl.engine.core.TaskUtils.createGenericTaskParameters(TaskUtils.java:209)
    com.siebel.etl.engine.core.Session.executeTasks(Session.java:2682)
    com.siebel.etl.engine.core.Session.run(Session.java:3249)
    java.lang.Thread.run(Thread.java:619)
    1872 SEVERE Wed Dec 19 14:25:42 GMT 2012 Number of running sessions : 2
    1873 SEVERE Wed Dec 19 14:25:48 GMT 2012 Request to start workflow : 'SIL_UA:SIL_Parameters_Update_DatesWeeks' has completed with error code 0
    1874 SEVERE Wed Dec 19 14:26:09 GMT 2012 pmcmd startworkflow -sv PowerCenter_Integration_Service -d Domain_gbrdevbi -u Administrator -p **** -f SIL_UA -lpf D:\Informatica\9.0.1\server\infa_shared\SrcFiles\DataWarehouse.DataWarehouse.SIL_UA.SIL_Parameters_Update_DatesWeeks.txt SIL_Parameters_Update_DatesWeeks
    Status Desc : Succeeded
    WorkFlowMessage : Workflow executed successfully.

    make sure you copied all CSV and look up files to infashared directory ?
    it is clearly saying database connection to w_param_G table. source for w_param_G is flatfile. check you created flatfile connection is created in DAC setup and also in generate parameters tab assign proper value for that connection
    Thanks
    Jay.

  • Need some quick help with redoing a website

    Hi, I did my website done in iWeb in 2008, published it, and have it hosted by GoDaddy. I want to take it offline for now and design a new 'under construction' site, but there is a chance that I might want to still go back to the original version.
    I see the current 'Domain' in Home Folder>Library>Application Support>iWeb.
    Can I just redo my site (still working in pre-2008 iWeb), publish it, and if I need to, use the old 'Domain' to revert to my current website?
    If yes, how do I do that....and, if 'no', what should I do?
    Thanks!

    Hi and thanks. To reply....
    I published the website in iWeb and it is on my MobleMe. It was done in iWeb v 1.1.2, and I have not upgraded iLife on the computer that I designed the website on, as I feared losing some/all of it in an upgrade.
    I do, however, pay GoDaddy for my corporate URL AND hosting....which I suspect is the forwarding and not 'hosting' per se....but on my Hosting account on GoDaddy it does say 'Shared Hosting'.
    I do not want to 'overwrite' my current site just yet, as I am uncertain about the next one's content or the time to do it the way I envision it. What I want to do is SAVE my current site in case I want it back and, in the meantime, put up a page that says Under Construction. Can you help with that?
    Much appreciated

  • I need some serious help with MPEG Streamclip and iMovie 11

    Hello, everyone!
    I hope that some kind soul here is able to help me. My sister-in-law asked me if I could help her re-edit a video that they made of a conference she gave because she didn't like the way some parts were edited. I oh-so-kindly (and perhaps stupidly) offered to help her out!
    A little background: even though I studied audiovisual communications in college, I leaned (a LOT) towards the audio production part of it and, lately, photography, too. That means that I'm not very good at the whole creating-a-movie-in-iMovie thing, even though I know it's supposed to be easy.
    So, here goes: I have a DVD from her which has the typical TS files for audio and video. I downloaded a program called MPEG Streamclip and then it said I needed to buy the QuickTime MPEG-2 Playback Component so that I could rip the DVD my sister-in-law gave me. I bought the component.
    I've converted, done small, 1-minute tests, of the DVD with MPEG Streamclip to DV and also to MP4 (just in case). I do it, then import them to iMovie 11. I don't edit anything at all, just a test to see how it looks, so I immediately send the project to iDVD to see how it looks. It DOES NOT look good.
    Compared to the DVD she gave me, which looks all smooth (picture-wise), mine has a certain amount (NOT HUGE) of pixelation. I can tell especially because there are some slides that were added to her project, so I can see the pixelated parts around the edges of the letters.
    The DVD she gave me does NOT look HD. In fact, it looks SD (4:3), so I don't believe it's that.
    If anybody here knows about this, what am I doing wrong? Am I not ripping it correctly using MPEG Streamclip? Am I not making the iMovie 11 project right? Am I burning in the "wrong way"?
    If it's the MPEG Streamclip ripping that I'm doing wrong, what are the settings I should be using? What format should I be using so that it is VERY iMovie-friendly?
    I want the final video that I would edit to look exactly as the one she gave me. That IS possible, right?
    For extra information, if needed, I am running a MacBook Pro, 13", i7 with 4 GB of RAM and am running OS 10.6.6. I've been a Mac user since the OS 9 days.
    Thanks in advance for anyone who helps me out.
    Serge

    Ok. Got it!!!
    Z, thanks a lot!! Now things don't look pixelated and my test burn looks exactly like the dvd my sister-in-law gave me... except for ONE THING:
    There are these graphics done in I-don't-know-what program with a cube transition. They look like when you do 3D cube transitions in virtual desktop, you know?
    Anyway, HER dvd looks completely smooth when you see these transitions but MY dvd looks... well, not right. It looks a bit like the screen or the letters "tremble" or shake a bit. I hope you can understand what I'm saying.
    I followed your advice to the letter and everything is perfect with the exception of those transitions (because after the transition passes and you see the slide with the writing, it looks completely smooth).
    Do you know of something that I can do to help with this problem?
    Thanks again!
    Serge

  • I need some urgent Help!

    Ok, i use my ibook (stats below) at my high school, (which has a one to one program, but i use my personal one) which has a DHCP network, so i have always been able to use my personal laptop at school on the internet, however, i got a email that said they were disabling DHCP TOMORROW and that the school laptops had to be switched location or something like that, ANYWAY, i want to use my personal lappy at school, but now that i can't use DHCP, what do i need to do? I'm kind of a networking newb here, if i have to ask the IT guys for an IP address, then i don't think its gonna work, i think they might frown upon me having my personal at school. Please help me!

    I suppose you don't care, but the IT people at your school do care about security issues. Asking us to circumvent their concerns by telling you how to access the school's computer system illegally violates the Terms of Use of the Apple Discussions.
    I suggest you either ask the school's permission to use their system with your computer or go elsewhere for help with your quest.
    This site is the property of Apple Computer. Perhaps you will appreciate the irony of asking them to participate in an illegal activity.

  • I need some serious help with Oracle Database....PLEASE!!

    I am using Microsoft Virtual PC 2007 that has Oracle Database 10g and Wondows XP installed on it.
    Database instance is DOWN but that is not the problem
    Listener is UP
    Agent Connection to Instance is DOWN, and I cannot get this running!
    How can I fix this problem? I am not an expert, but I have been trying for a long time to fix this issue, but I can't. It just came to the point that I want to grab my pc and throw it across the room.
    Error message: ORA-12505: TNS:listener does not currently know of SID given in connect descriptor (DBD ERROR: OCIServerAttach)
    Here is my LISTENER.ORA file:
    # listener.ora Network Configuration File: C:\oracle\product\10.2.0\db_1\network\admin\listener.ora
    # Generated by Oracle configuration tools.
    SID_LIST_LISTENER =
    (SID_LIST =
    (SID_DESC =
    (SID_NAME = PLSExtProc)
    (ORACLE_HOME = C:\oracle\product\10.2.0\db_1)
    (PROGRAM = extproc)
    LISTENER =
    (DESCRIPTION_LIST =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
    (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.109)(PORT = 1521))
    Here is my TSNNAME.ORA file:
    # tnsnames.ora Network Configuration File: C:\oracle\product\10.2.0\db_1\network\admin\tnsnames.ora
    # Generated by Oracle configuration tools.
    ORCL =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.109)(PORT = 1521))
    (CONNECT_DATA =
    (SERVER = DEDICATED)
    (SERVICE_NAME = orcl)
    EXTPROC_CONNECTION_DATA =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
    (CONNECT_DATA =
    (SID = PLSExtProc)
    (PRESENTATION = RO)
    Once again, I am not an expert, so please try to explain it as simple as possible...I know, I am an idiot when it comes to networking issues.
    if you guys need some more information, just let me know!
    Thank you!

    What I mean is that I can get the Instance UP with no problem, but the Connection with the Instance is the problem.
    C:\Documents and Settings\Paolo\Desktop\courselabs\labs>lsnrctl service
    LSNRCTL for 32-bit Windows: Version 10.2.0.1.0 - Production on 25-NOV-2009 21:38
    :06
    Copyright (c) 1991, 2005, Oracle. All rights reserved.
    Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1)))
    Services Summary...
    Service "PLSExtProc" has 1 instance(s).
    Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
    Handler(s):
    "DEDICATED" established:0 refused:0
    LOCAL SERVER
    Service "orcl" has 1 instance(s).
    Instance "orcl", status READY, has 1 handler(s) for this service...
    Handler(s):
    "DEDICATED" established:144 refused:0 state:ready
    LOCAL SERVER
    Service "orclXDB" has 1 instance(s).
    Instance "orcl", status READY, has 1 handler(s) for this service...
    Handler(s):
    "D000" established:0 refused:0 current:0 max:1002 state:ready
    DISPATCHER <machine: PAOLOSCAMARDELL, pid: 2576>
    (ADDRESS=(PROTOCOL=tcp)(HOST=paoloscamardell)(PORT=2307))
    Service "orcl_XPT" has 1 instance(s).
    Instance "orcl", status READY, has 1 handler(s) for this service...
    Handler(s):
    "DEDICATED" established:144 refused:0 state:ready
    LOCAL SERVER
    The command completed successfully
    C:\Documents and Settings\Paolo\Desktop\courselabs\labs>lsnrctl status
    LSNRCTL for 32-bit Windows: Version 10.2.0.1.0 - Production on 25-NOV-2009 21:52
    :03
    Copyright (c) 1991, 2005, Oracle. All rights reserved.
    Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1)))
    STATUS of the LISTENER
    Alias LISTENER
    Version TNSLSNR for 32-bit Windows: Version 10.2.0.1.0 - Produ
    ction
    Start Date 25-NOV-2009 11:50:27
    Uptime 0 days 10 hr. 1 min. 39 sec
    Trace Level off
    Security ON: Local OS Authentication
    SNMP OFF
    Listener Parameter File C:\oracle\product\10.2.0\db_1\network\admin\listener.o
    ra
    Listener Log File C:\oracle\product\10.2.0\db_1\network\log\listener.log
    Listening Endpoints Summary...
    (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(PIPENAME=\\.\pipe\EXTPROC1ipc)))
    (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.1.109)(PORT=1521)))
    Services Summary...
    Service "PLSExtProc" has 1 instance(s).
    Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
    Service "orcl" has 1 instance(s).
    Instance "orcl", status READY, has 1 handler(s) for this service...
    Service "orclXDB" has 1 instance(s).
    Instance "orcl", status READY, has 1 handler(s) for this service...
    Service "orcl_XPT" has 1 instance(s).
    Instance "orcl", status READY, has 1 handler(s) for this service...
    The command completed successfully
    C:\Documents and Settings\Paolo\Desktop\courselabs\labs>

  • I'm new to java and I need some quick help with NetBeans.

    Hi. To whomever can help here's the problem. I've been trying to install netbeans ide 5.0 on my computer for a while now and i can't seem to find out what is wrong. I'm in a java programming course and i need the J2SE Developement Kit 5.0 Update 7 and NetBeans IDE 5.0 Installer on my comp. Whenever i go to install it, it can't automatically create a directory and has erroe null in place of it. Whenever i made a new directory for it a page would come up telling me all of the errors during the installation which are null. Since i have administrator privelages and plenty of free space on my hardrive.

    Hi,
    I want to suggest you that
    1.please check if any prerequisite is require before installing the NetBeans IDE,i hope there is nothing like that except proper jdk on your machine.
    2.if you already having JDK on your machine check for the compatibility of that jdk version with the required NetBeans IDE version.
    3.follow the steps provided to install the NetBeans IDE 5.0 for that refer the below link
    http://www.netbeans.org/community/releases/50/install.html
    hope you will get rid of the problem .....
    ---Vidya

  • ADF Exception--Need some urgent help

    Hi Guys,
    I am a new biee in ADF and am trying to override an apply button on a JSPX page. I have created a Custom Bean, which popultes a drop down list and now now i want to select one item from drop down and when i click the apply button, the selected item from drop down needs to be saved in DB.
    Below is the code that i have written, however when i am trying to execute it i am getting exceptions. Please Help
    Caused By: javax.faces.FacesException: javax.el.PropertyNotFoundException: Missing Resource in EL implementation: ???propertyNotReadable???
    at com.sun.faces.application.ApplicationImpl.createComponent(ApplicationImpl.java:261)
    at javax.faces.webapp.UIComponentELTag.createComponent(UIComponentELTag.java:222)
    at javax.faces.webapp.UIComponentClassicTagBase.createChild(UIComponentClassicTagBase.java:513)
    at javax.faces.webapp.UIComponentClassicTagBase.findComponent(UIComponentClassicTagBase.java:782)
    at javax.faces.webapp.UIComponentClassicTagBase.doStartTag(UIComponentClassicTagBase.java:1354)
    at org.apache.myfaces.trinidad.webapp.UIXComponentELTag.doStartTag(UIXComponentELTag.java:71)
    at oracle.adfinternal.view.faces.unified.taglib.input.UnifiedSelectOneChoiceTag.doStartTag(UnifiedSelectOneChoiceTag.java:51)
    at oracle.jsp.runtime.tree.OracleJspBodyTagNode.executeHandler(OracleJspBodyTagNode.java:50)
    at oracle.jsp.runtime.tree.OracleJspCustomTagNode.execute(OracleJspCustomTagNode.java:262)
    at oracle.jsp.runtime.tree.OracleJspClassicTagNode.evalBody(OracleJspClassicTagNode.java:87)
    at oracle.jsp.runtime.tree.OracleJspBodyTagNode.executeHandler(OracleJspBodyTagNode.java:58)
    at oracle.jsp.runtime.tree.OracleJspCustomTagNode.execute(OracleJspCustomTagNode.java:262)
    at oracle.jsp.runtime.tree.OracleJspClassicTagNode.evalBody(OracleJspClassicTagNode.java:87)
    at oracle.jsp.runtime.tree.OracleJspBodyTagNode.executeHandler(OracleJspBodyTagNode.java:58)
    at oracle.jsp.runtime.tree.OracleJspCustomTagNode.execute(OracleJspCustomTagNode.java:262)
    at oracle.jsp.runtime.tree.OracleJspClassicTagNode.evalBody(OracleJspClassicTagNode.java:87)
    at oracle.jsp.runtime.tree.OracleJspBodyTagNode.executeHandler(OracleJspBodyTagNode.java:58)
    at oracle.jsp.runtime.tree.OracleJspCustomTagNode.execute(OracleJspCustomTagNode.java:262)
    at oracle.jsp.runtime.tree.OracleJspClassicTagNode.evalBody(OracleJspClassicTagNode.java:87)
    at oracle.jsp.runtime.tree.OracleJspBodyTagNode.executeHandler(OracleJspBodyTagNode.java:58)
    at oracle.jsp.runtime.tree.OracleJspCustomTagNode.execute(OracleJspCustomTagNode.java:262)
    at oracle.jsp.runtime.tree.OracleJspClassicTagNode.evalBody(OracleJspClassicTagNode.java:87)
    at oracle.jsp.runtime.tree.OracleJspBodyTagNode.executeHandler(OracleJspBodyTagNode.java:58)
    at oracle.jsp.runtime.tree.OracleJspCustomTagNode.execute(OracleJspCustomTagNode.java:262)
    at oracle.jsp.runtime.tree.OracleJspClassicTagNode.evalBody(OracleJspClassicTagNode.java:87)
    at oracle.jsp.runtime.tree.OracleJspIterationTagNode.executeHandler(OracleJspIterationTagNode.java:45)
    at oracle.jsp.runtime.tree.OracleJspCustomTagNode.execute(OracleJspCustomTagNode.java:262)
    at oracle.jsp.runtime.tree.OracleJspClassicTagNode.evalBody(OracleJspClassicTagNode.java:87)
    at oracle.jsp.runtime.tree.OracleJspBodyTagNode.executeHandler(OracleJspBodyTagNode.java:58)
    at oracle.jsp.runtime.tree.OracleJspCustomTagNode.execute(OracleJspCustomTagNode.java:262)
    at oracle.jsp.runtime.tree.OracleJspNode.execute(OracleJspNode.java:89)
    at oracle.jsp.runtimev2.ShortCutServlet._jspService(ShortCutServlet.java:89)
    at oracle.jsp.runtime.OracleJspBase.service(OracleJspBase.java:29)
    Below is the extract from the jsff.xml
    <mds:insert parent="pfl1" position="first">
    <af:selectOneChoice xmlns:af="http://xmlns.oracle.com/adf/faces/rich" id="e4680291729" label="Custom Dropdown"
    valueChangeListener="#{backingBeanScope.userformbean.submitActionValidator}" binding="#{backingBeanScope.userformbean.emailSelected}">
                   <f:selectItems xmlns:f="http://java.sun.com/jsf/core" value="#{backingBeanScope.userformbean.emaillistdropdown}" id="emlis12" />
              </af:selectOneChoice>
    </mds:insert>
    package oracle.iam.ui.sample.userform.view;
    import java.util.ArrayList;
    import java.util.HashSet;
    import java.util.List;
    import java.util.Set;
    import javax.faces.component.UIComponent;
    import java.util.StringTokenizer;
    import javax.el.MethodExpression;
    import javax.faces.context.FacesContext;
    import javax.faces.event.ActionEvent;
    import javax.faces.model.SelectItem;
    import oracle.adf.model.BindingContext;
    import oracle.adf.view.rich.component.rich.input.RichSelectItem;
    import oracle.adf.view.rich.component.rich.input.RichSelectOneChoice;
    import oracle.binding.BindingContainer;
    import oracle.iam.identity.exception.NoSuchUserException;
    import oracle.iam.identity.exception.UserSearchException;
    import oracle.iam.identity.usermgmt.api.UserManager;
    import oracle.iam.identity.usermgmt.api.UserManagerConstants;
    import oracle.iam.identity.usermgmt.vo.User;
    import oracle.iam.platform.Platform;
    import oracle.iam.platform.entitymgr.vo.SearchCriteria;
    import oracle.iam.selfservice.exception.UserLookupException;
    import oracle.jbo.uicli.binding.JUCtrlListBinding;
    import org.apache.tools.ant.taskdefs.Get;
    //import oracle.iam.ui.sample.common.model.OIMClientFactory;
    public class UserFormRequestBean {
    private static final String USER_LOGIN_ATTRIBUTE = "usr_login__c";
    private static final String EMAIL_ATTRIBUTE = "usr_email__c";
    private static final String EMAIL_LIST_ATTRIBUTE = "EMAIL_LIST__c";
    private static final String LAST_NAME_ATTRIBUTE = "usr_last_name__c";
    private static List<SelectItem> emaillistdropdown;
    private static RichSelectOneChoice emailSelected;
    private String preffemail;
    private static String filterboxvalue;
    private List<User> userlist;
    private static final String USR_LOGIN="oimcontext.currentUser.usr_key";
    private UIComponent emaillist;
    public UserFormRequestBean() {
    setFilterboxvalue("test custom bean");
    setEmaillistdropdown(getEmailList());
    public static List getEmailList() {
    // String userlastname =
    // FacesUtils.getAttributeBindingValue(LAST_NAME_ATTRIBUTE, String.class);
    emaillistdropdown = new ArrayList<SelectItem>();
    try {
    UserManager usrService = OIMClientFactory.getUserManager();
    Set retAttrs = new HashSet();
    String emailAttribute=null;
    SearchCriteria criteria = new SearchCriteria(UserManagerConstants.AttributeName.USER_LOGIN.getId(),"XELSYSADM", SearchCriteria.Operator.EQUAL);
    // SearchCriteria(UserManagerConstants.AttributeName.USER_LOGIN.getId(),userlogin, SearchCriteria.Operator.EQUAL);
    retAttrs.add("EMAIL_LIST");
    List<User> users = usrService.search(criteria, retAttrs, null);
    for (int i = 0; i < users.size(); i++) {
    emailAttribute =(String)users.get(i).getAttribute("EMAIL_LIST");
    System.out.println("Value for email :: " + emailAttribute);
    StringTokenizer st = new StringTokenizer(emailAttribute, ",");
    while (st.hasMoreElements()) {
    SelectItem emaItem = new SelectItem();
    String token = st.nextToken();
    emaItem.setLabel(token);
    emaItem.setValue(token);
    emaillistdropdown.add(emaItem);
    } catch (UserSearchException e) {
    e.printStackTrace();
    return emaillistdropdown;
    * Generic value change listener. Handles value change events of all customized components.
    * Source component is identified by component reference.
    public void submitActionValidator(ActionEvent actionEvent) {
    BindingContainer bindings = BindingContext.getCurrent().getCurrentBindingsEntry();
    // Get the sepecific list binding
    JUCtrlListBinding listBinding = (JUCtrlListBinding)bindings.get("Custom Dropdown");
    // Get the value which is currently selected
    Object emailSelected = listBinding.getSelectedValue();
    System.out.println("Inside SubmitAction Avlidator***********************************");
    // emailSelected =
    // (RichSelectOneChoice)actionEvent.getSource();
    System.out.println("emailSelected***********************************:"+emailSelected);
    if (emailSelected != null) {
    preffemail = emailSelected.toString();
    System.out.println("preffemail***********************************"+preffemail);
    FacesContext facesContext = FacesContext.getCurrentInstance();
    FacesUtils.setAttributeBindingValue(EMAIL_ATTRIBUTE,
    preffemail);
    // execute original submit button action listener
    MethodExpression originalActionListener =
    FacesUtils.getMethodExpressionFromEL("#{backingBeanScope.MyInformationUIBean.applyButton}",
    null,
    new Class[] { ActionEvent.class });
    originalActionListener.invoke(FacesUtils.getELContext(),new Object[] {actionEvent});
    public void setemaillist(UIComponent emaillist) {
    this.emaillist = emaillist;
    public UIComponent getemaillist() {
    return emaillist;
    public static void setFilterboxvalue(String filterboxvalue) {
    filterboxvalue = filterboxvalue;
    public String getFilterboxvalue() {
    return filterboxvalue;
    public void setEmaillistdropdown(List<SelectItem> emaillistdropdown) {
    this.emaillistdropdown = emaillistdropdown;
    public List<SelectItem> getEmaillistdropdown() {
    return emaillistdropdown;
    public void setEmailSelected(RichSelectOneChoice emailSelected) {
    this.emailSelected = emailSelected;
    public static RichSelectOneChoice getEmailSelected() {
    return emailSelected;
    public void setPreffemail(String preffemail) {
    this.preffemail = preffemail;
    public String getPreffemail() {
    return preffemail;
    }

    There isn't sufficient detail in your post. To confirm,
    1) Are you customizing an out-of-the-box WebCenter taskflow?
    2) How are you deploying the new managed bean class? Is it deployed as an ADF Library jar within a shared library?
    3) If ADF Library JAR, do you have the managed bean defined in the config files (adfc-config or faces-config) within the ADF Library JAR

  • Need some quick help with jbutton

    Hi,
    My first post so please be gentle!
    I currently have two buttons in my container. The first one when pressed calls another function that generates a set of coordinates (button = generate). I now have another button that wants to take those coordinates and draw them on-screen, but I'm having trouble doing this since I can't get the "generate" button function to pass the xycoords over to the "draw" button function. I'm more of a Fortran/Perl programmer and I'm a bit confused how to go about this. I tried making the variable (xycoords) a gloabl variable, but id rather not do this.
    Any tips?
    Cheers,
    Adriano

    Sure, show us the code. Otherwise we have to try to read you mind.
    Here is the scenario you are in:
    Event Driven Method (ActionPerformed/ButtonClicked/etc): you do not have arguments that you can control, so if you want to use something from within that method you have to have visibility to it (global definition with respect to the routine) and in the Java world that usually boils down to class variables or some type of public data class.
    Now, it you want the coordinates of the click event, that is contained in the MouseEvent... getX and getY, so you can use these as arguments to other methods from within your MouseListener.

  • Help with java code

    im pretty new to java coding and im having trouble getting one method to work. I would appreciate it ifsum could look at the following code in the runpayroll method to see where im going wrong as it will not compile
    import java.io.FileReader;
    import java.io.FileWriter;
    import java.io.BufferedReader;
    import java.io.PrintWriter;
    import java.io.IOException;
    import java.io.File;
    * Textfile-based staff list with payroll, appointment, and redundancy functions
    * @author Andrew Mackel
    * @version 1.0
    public class StaffList
    // CONSTANTS ***************************************************************
    final String STAFF_FILE = "staff.txt";
    final String TEMP_FILE = "temp.txt";
    final int[] PAYSCALE = {1000, 1050, 1100, 1150, 1200,
    1300, 1400, 1600, 1800, 2000, 2500};
    final int SEVERANCE_MULTIPLE = 3;
    // INSTANCE VARIABLES ******************************************************
    // CONSTRUCTORS ************************************************************
    * Constructor
    StaffList ()
    // no actions
    // METHODS *****************************************************************
    // TO DO: write addStaffMember() method which appends a line to the staff
    // file containing the number, name and grade of the new member
    // of staff (tab separated)
    // TO DO: write runPayroll() method which prints a header saying
    // "XXX Payroll" where XXX is the month, then reads each record
    // in the staff file and for each prints an advice of the form:
    // Salary advice for Freda Bloggs
    // Employee number: 42
    // Employee grade: 6
    // Monthly salary: �1400
    // and finally returns the total cost of the month's payroll
    * Remove staff member from file and calculate severance payment
    * @param pNum staff number
    * @return severance payment due (or -1 if pNum not found in staff file)
    public int makeRedundant(int pNum)
    String inputLine;
    String[] inputFields;
    int staffNum;
    int staffGrade = -1;
    int severance;
    try
    FileReader fr = new FileReader(STAFF_FILE);
    BufferedReader br = new BufferedReader (fr);
    FileWriter fw = new FileWriter(TEMP_FILE, false);
    PrintWriter pw = new PrintWriter(fw);
    inputLine = br.readLine();
    while (inputLine != null)
    inputFields = inputLine.split("\t");
    staffNum = Integer.parseInt(inputFields[0]);
    if (staffNum == pNum)
    staffGrade = Integer.parseInt(inputFields[2]);
    else
    pw.println(inputLine);
    inputLine = br.readLine();
    fr.close();
    fw.close();
    if (staffGrade != -1)
    File staffFile = new File(STAFF_FILE);
    File tempFile = new File(TEMP_FILE);
    staffFile.delete();
    tempFile.renameTo(staffFile);
    severance = PAYSCALE[staffGrade] * SEVERANCE_MULTIPLE;
    else
    severance = -1;
    return severance;
    catch (IOException ioe)
    User.message("Unable to read/write from staff file");
    User.message("EXCEPTION: " + ioe);
    return -1;
    public void addStaffMember (int pNum, String pName, int pGrade)
    try
    // create writers for output file (to append not overwrite)
    FileWriter fw = new FileWriter(STAFF_FILE, true);
    PrintWriter pw = new PrintWriter(fw);
    // print pNum, pName and pGrade (TAB-separated) and close file
    pw.println(pNum + "\t" + pName + "\t" + pGrade);
    pw.close();
    catch (java.io.IOException ioe)
    // there has been an output error - display message and details
    User.message("ERROR: unable to write to staff file");
    User.message("EXCEPTION: " + ioe);
    * Display a list of all invoices and total on system console
    void runPayroll(String pMonth)
    String inputLine;
    String[] inputFields;
    int pNum;
    String pName;
    int pGrade;
    int total=0;
    System.out.println("Payroll for the month of: " + pMonth);
    try
    // create readers for input file
    FileReader fr = new FileReader(STAFF_FILE);
    BufferedReader br = new BufferedReader(fr);
    // read first line
    inputLine = br.readLine();
    // read lines of input until EOF
    while (inputLine != null)
    // split input line by tabs and assign fields to variables
    inputFields = inputLine.split("\t");
    pNum = inputFields[0];
    // print invoice details and add to total
    System.out.println("Staff Member: " + pNum + pName + pGrade + " - Salary: " + PAYSCALE);
    total = total;
    // read next line of input
    inputLine = br.readLine();
    // close file and print total
    fr.close();
    System.out.println("TOTAL: " + total);
    catch (java.io.IOException ioe)
    // there has been an input error - display message and details
    User.message("ERROR: unable to read invoice file");
    User.message("EXCEPTION: " + ioe);
    }

    1) use code tags
    2) who or what is ifsum ? (In other words spell things out and make your message clear
    3) it won't compile so it's likely giving you errors - those help people help you lots.
    4) keep the code short - in other words if you are having problems in runpayroll post that to start as the rest is just taking attention away from your problem.

Maybe you are looking for

  • Set read only attributes

    Is there a way to set read only for specific attributes of an Entity in MDS? RaghuM

  • How do i enable java 7 plugin on to firewall

    ok so the macbook air comes with java 6 installed but i changed my java pathway on a game (minecraft) to java 7 because i needed java 7 to run it. so now i did but to enable playing in lan party i need to allow access from the java 7 to my firewall t

  • Mavericks install created a standard user account

    I'am locked out of making any changes as the padlock unlock keeps asking for Admin Name and Password. Also Was going to try and migrate my account from 10.6.8 but Migration Assistant is also refusing to open.

  • Creating multiple BP Roles automatically after replicated BP to CRM

    Hi All, We are working on CRM 5.0 and ECC 6 as a back end system. As per our requirement we want the clarification for the below scenario. We are downloading Employee records from ECC to CRM.After replicating Employee records we want to add Consumer

  • Can't acess my iMessages

    I can't acess my access my iMessages on my ipad, it just keeps saying verifying constantly