Please Help ~ Java Problems

Please help me.. I have an error that says in a box that pops up when I start my computer that says this as the Title: "WJViewError" and then this in the middle of the box: "ERROR: java.lang.NoClassDefFoundError" . I don't know how to fix this, maybe I have to re-install something... please help. I can't get into any Yahoo.com free games (Spades) or pogo.com games (Spades). others too, and that's what i want to fix. please post things i should download, i looked around everywhere and can't find anything to help me. my email is [email protected]

Try reinstall Java or the JRE *Try after reading bottom
Try install/updateing JRE *Try after reading bottom
but first try/check the CLASSPATH & PATH variables in autoexec.bat in your c root directory, make sure that (PATH)they point to your jre/bin dir or your javaSDK/bin dir, and make sure CLASSPATH point to class files of java installion. Also, in Control Panel if installed make sure the java console applet handles the java code for your web browser and make sure that the Classpath & path that is in that java console applet points to the correct directories.
----- hope that help, Jimdogee

Similar Messages

  • .problem is that icon of  iblacklist in i tune is "disc phone" like One, named iblacklist, but  on screen appear as "secret contact" not as iblacklist icon wich is  contact like icon .please  help . iblacklist problem still , I download it again ,this was

    .problem is that icon of  iblacklist in i tune is "disc phone" like One, named iblacklist, but  on screen appear as "secret contact" not as iblacklist icon wich is  contact like icon .please  help .
    iblacklist problem still , I download it again ,this was not helpfull 

    Have you read my reply to one of your duplicate threads : https://discussions.apple.com/message/22774845#22774845 ?

  • Please help-image problem (display)

    Can someone please help with this?
    I keep receiving an error (below) while trying to execute the code...
    2001-07-19 11:55:02 - Ctx( /dev ): IOException in: R( /dev + /servlet/getImage + null) Connection reset by peer: socket write error
    My setup is Tomcat 3.2
    JDBC: Oracle's classes12.zip
    JDK: Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0-C)
    Java HotSpot(TM) Client VM (build 1.3.0-C, mixed mode)
    I have copied my simple code below for review:
    package lmmfcd.images;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.io.*;
    import java.sql.*;
    import javax.servlet.jsp.*;
    import javax.servlet.jsp.tagext.*;
    import org.apache.jasper.runtime.*;
    import java.beans.*;
    import org.apache.jasper.JasperException;
    public class getImages extends HttpServlet
         public void doGet(HttpServletRequest request, HttpServletResponse response)
                   throws ServletException, IOException
              //Grabs and assigns the PageContext
                   JspFactory _jspxFactory = null;
                   PageContext pageContext = null;
                   Object page = this;
                   _jspxFactory = JspFactory.getDefaultFactory();
                   pageContext = _jspxFactory.getPageContext(this, request, response,
                        "", true, 8192, true);
              //End of the PageContext Stuff
              Connection conn = (Connection)pageContext.findAttribute("conn");
                   try
                        ResultSet rset = null;
                        String queryCmd =
                                  "SELECT     image "+
                                  "FROM          sgps.images "+
                                  "WHERE          pn = '13507028' "+
                                  " AND          pic_num = '1' ";
                        Statement stmt = conn.createStatement();
                        rset = stmt.executeQuery(queryCmd);
                        rset.next();
                        Blob blob = null;
                        blob = rset.getBlob("image");
                        response.setContentType("image/jpeg");
                        byte[] ba = blob.getBytes(1, (int)blob.length());
                        System.out.println("just above OutputStream");
                        response.getOutputStream().write(ba, 0, ba.length);
                        response.getOutputStream().flush();
                        response.getOutputStream().close();                    
                   catch(SQLException e)
                        throw new ServletException("Problem");
    }

    It compiled okay, but still displayed the broken image as the result....
              if (rset != null)
                   try
                        BLOB blob = null;
                        blob = (BLOB)rset.getObject("image");
                        response.setContentType("image/jpeg");
                        InputStream in = rset.getBinaryStream("image");
                        //Have also used:
                        //InputStream in = blob.getBinaryStream();
                        OutputStream out = response.getOutputStream();
                        byte b;
                        while ((b = (byte)in.read()) != 1)
                             out.write(b);
                        in.close();
                        out.flush();
                        out.close();
                   catch(SQLException e)
                        throw new ServletException("Problem");
              }

  • Please help. proxy problem

    Hi there,
    I am facing a problem in accessing net content. I am using proxy to get net access.
    here is my code:
    Properties props=System.getProperties();
    props.put("proxySet", "true");
    props.setProperty( "proxyHost", "192.168.6.22" );
    props.setProperty( "proxyPort", "80" );
    props.setProperty( "proxyUser", "mv5217" );
    props.setProperty( "proxyPassword", "surya" );
    System.setProperties(props);
         String content="";
         URL url = new URL("http://www.rediff.com");//ew URL("http://www.yahoo.com");
    BufferedReader in = new BufferedReader(new InputStreamReader(url.openStream()));
         String inputLine;
         while ((inputLine = in.readLine()) != null)
         content+=inputLine;
         in.close();
         System.out.println("Content "+content);
    }catch(Exception e){
    e.printStackTrace();
    the above code some time returns me blank string and some times below exception
    java.io.IOException: Server returned HTTP response code: 407 for URL: http://www.rediff.com
         at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:558)
         at java.net.URL.openStream(URL.java:851)
         at TestingClass.<init>(TestingClass.java:26)
         at TestingClass.main(TestingClass.java:40)
    I am getting the exception even sending a mail to yahoo pop server. below is the my java mail code.
    public static String MAIL_HOST = "smtp.mail.yahoo.com";
    public static String MAIL_HOST2 = "pop.mail.yahoo.com";
    * Constructor
    public JavaMailToYahooServer() {
    String from = "[email protected]";
    String subject = "Testing of sending mail";
    String body = "this is the mail content";
    String to = "[email protected]";
    MAIL_FROM = from;
    MAIL_SUBJECT=subject;
    MAIL_BODY=body;
    MAIL_TO=to;
    Properties props = System.getProperties();
    props.put("proxySet", "true");
    props.put("proxyHost", "192.168.6.22");
    props.put("proxyPort", "80");
    props.put("proxyUser", "proxy user id");
    props.put("proxyPassword", "proxy password");
    //Properties props = new Properties();
    props.put("mail.smtp.host", MAIL_HOST);
    System.setProperties(props);
    Session sess = Session.getDefaultInstance(props, null);
    try {
    // Connect to host
    //Store store = sess.getStore("pop3");
    //store.connect(MAIL_HOST2, -1, "vmeghraj", "surya");
    // Create a message
    Message msg = new MimeMessage(sess);
    msg.setFrom(new InternetAddress(from));
    InternetAddress[] address = {new InternetAddress(to)};
    msg.setRecipients(Message.RecipientType.TO, address);
    msg.setSubject(subject);
    msg.setSentDate(new Date());
    msg.setContent(body, "text/html; charset=ISO-8859-1");//HTML type
    //msg.setContent(body); //Text type
    // Send the message
    Transport trans = sess.getTransport("smtp");
    trans.connect(MAIL_HOST,"my yahoo id","my yahoo password");
    trans.send(msg);
    // Let the user know that the mail was sent
    trans.close();
    }catch (Exception ex) {
    System.out.println("Errorr : "+ex);
    for this I am gettin below shown Exception
    Errorr : javax.mail.MessagingException: Unknown SMTP host: smtp.mail.yahoo.com;
    nested exception is:
         java.net.UnknownHostException: smtp.mail.yahoo.com
    What wrong I am doing in the above coding..
    Please help me .... it is an urgent requirement
    thanks in advance,
    Veerendar

    refresh

  • Please help, java program terminating unexpectedly without reason

    ok, so I have a project I'm working on, here's its description:
    Create a new project named FML_Pig where F is your first initial, M is your middle initial, and L is your last initial. For example, if your name is Alfred Edward Neuman then you would name your project AEN_Pig. If necessary, add a new Java file to this project named FML_Pig.
    Add a java file to the project named FML_Dice.
    Design and implement a Dice class as follows. The Dice class has 2 twenty&#8209;sided dice with numbers on the faces (1 � 20) and 2 twenty-six-sided dice with letters on the faces (a � z).
    import java.util.Random;
    public class FML_Dice
    private static Random gen = new Random();
    private final static int NUM_SIDES = 20;
    private int die1, die2, numSnakeEyes, numVowels, totalPoints;
    private char die3, die4;
    Part 1
    Add a rollDice() method to your FML_Dice class that sets die1 and die2 to a random number between 1 and 20 and it sets die3 and die4 to a random character between �a� and �z�.
    Helpful Hint:
    dice3 = (char)(�a� + gen.nextInt(26)); // sets dice3 to a random char between �a� and �z�.
    Part 2
    Write a constructor that sets die1 and die2 to a random number between 1 and 20 and it sets die3 and die4 to a random character. Your constructor can simply call rollDice() to do this. It should also initialize numSnakeEyes, numVowels, and totalPoints to 0 (after you roll the dice).
    Part 3
    Write methods getDie1(), getDie2(), getDie3(), and getDie4() that returns the value of the respective die. Write a method numSnakes() that returns the number of snake eyes that have been rolled. Write a method numVowels() that returns the number of vowels that have been rolled. Write a method totalPts() that returns the totalPoints.
    Part 4
    Write a toString() method that overwrites the default toString() method. It should return a String representation of the value of all 4 die. For example, 17 2 h w.
    Part 5
    Write a method updateTotals that updates numVowels, numSnakeEyes, and totalPoints based on the current values of die1, die2, die3, and die4. numVowels should be incremented by 1 if either die3 or die4 are a vowel. However, if both die3 and die4 are vowels, the totalPoints should be reset to 0 and numVowels should be reset to 0 also. numSnakeEyes should be incremented by 1 if either die1 or die2 have a face value of 1 (this is not truly a snake eyes, but it gives better odds for the game). totalPoints should be incremented by the sum of die1 and die2 multiplied by (numSnakeEyes + 1).
    Part 6
    Write a main program (use the one in FML_Pig.java) that plays a game of Pig. In this game, two people play against each other. Player1 begins by rolling the dice. The total of die1 and die2 is added to his total score. Player1�s turn continues until he/she rolls a total of 4 vowels then the turn switches to Player2. Whenever a turn switches to the other player, the number of vowels is reset to zero. Also, if at any time both die3 and die4 are vowels, the total score is reset to 0 and the turn switches to the other player. (So the turn switches to the other player whenever the total number of vowels reaches four or there are two vowels rolled at the same time.)
    If a player rolls snakeeyes (for our game, snakeeyes occurs whenever either of the dice have a face value of one � in reality, both die1 and die2 should have a face value of one but then snakeeyes would occur only once every 400 rolls), then his point values are doubled from that point on (all future rolls for the rest of the game, point values for this player are doubled). When a player rolls snake eyes again, point values are tripled for that roll and all future rolls. (Three snake eyes, quadrupled, etc.)
    (continued on the next page)
    Be sure to display the results of the roll for each turn.
    First player to get to 2000 points wins the game and gets to oink like a pig.
    Note: Both players need their own set of Dice since the Dice keeps track of the totalPoints, the number of snake eyes rolled so far, and the number of vowels rolled so far for that particular player. You can do this simply by declaring it that way in the main program:
    Dice player1 = new Dice();
    Dice player2 = new Dice();
    You may add additional methods and instance variables to the class as needed. For example, I would probably write a private helper method isVowel() that is passed a char argument ch and returns true if ch is a vowel.
    Also, you can have the computer play for both player 1 and player 2. Simply loop it until somebody wins. Print out the result for each turn including who rolled the dice (player 1 or player 2), what they rolled, how many snakeeyes do they have, how many points did they get for this turn, and how many total points do they have.
    When you are completely finished, hand in just the java files (FLM_Dice & FLM_Pig). If you happened to write any other classes, make sure they are named with the FML format, and turn these in as well. I do not need EasyReader or p.
    Oink! Oink!
    This pig won the game --------->
    so here's my code:
    this isn't my code but is required to compile my code: // package com.skylit.io;
    import java.io.*;
    *  @author Gary Litvin
    *  @version 1.2, 5/30/02
    *  Written as part of
    *  <i>Java Methods: An Introduction to Object-Oriented Programming</i>
    *  (Skylight Publishing 2001, ISBN 0-9654853-7-4)
    *   and
    *  <i>Java Methods AB: Data Structures</i>
    *  (Skylight Publishing 2003, ISBN 0-9654853-1-5)
    *  EasyReader provides simple methods for reading the console and
    *  for opening and reading text files.  All exceptions are handled
    *  inside the class and are hidden from the user.
    *  <xmp>
    *  Example:
    *  =======
    *  EasyReader console = new EasyReader();
    *  System.out.print("Enter input file name: ");
    *  String fileName = console.readLine();
    *  EasyReader inFile = new EasyReader(fileName);
    *  if (inFile.bad())
    *    System.err.println("Can't open " + fileName);
    *    System.exit(1);
    *  String firstLine = inFile.readLine();
    *  if (!inFile.eof())   // or:  if (firstLine != null)
    *    System.out.println("The first line is : " + firstLine);
    *  System.out.print("Enter the maximum number of integers to read: ");
    *  int maxCount = console.readInt();
    *  int k, count = 0;
    *  while (count < maxCount && !inFile.eof())
    *    k = inFile.readInt();
    *    if (!inFile.eof())
    *      // process or store this number
    *      count++;
    *  inFile.close();    // optional
    *  System.out.println(count + " numbers read");
    *  </xmp>
    public class EasyReader
      protected String myFileName;
      protected BufferedReader myInFile;
      protected int myErrorFlags = 0;
      protected static final int OPENERROR = 0x0001;
      protected static final int CLOSEERROR = 0x0002;
      protected static final int READERROR = 0x0004;
      protected static final int EOF = 0x0100;
       *  Constructor.  Prepares console (System.in) for reading
      public EasyReader()
        myFileName = null;
        myErrorFlags = 0;
        myInFile = new BufferedReader(
                                new InputStreamReader(System.in), 128);
       *  Constructor.  opens a file for reading
       *  @param fileName the name or pathname of the file
      public EasyReader(String fileName)
        myFileName = fileName;
        myErrorFlags = 0;
        try
          myInFile = new BufferedReader(new FileReader(fileName), 1024);
        catch (FileNotFoundException e)
          myErrorFlags |= OPENERROR;
          myFileName = null;
       *  Closes the file
      public void close()
        if (myFileName == null)
          return;
        try
          myInFile.close();
        catch (IOException e)
          System.err.println("Error closing " + myFileName + "\n");
          myErrorFlags |= CLOSEERROR;
       *  Checks the status of the file
       *  @return true if en error occurred opening or reading the file,
       *  false otherwise
      public boolean bad()
        return myErrorFlags != 0;
       *  Checks the EOF status of the file
       *  @return true if EOF was encountered in the previous read
       *  operation, false otherwise
      public boolean eof()
        return (myErrorFlags & EOF) != 0;
      private boolean ready() throws IOException
        return myFileName == null || myInFile.ready();
       *  Reads the next character from a file (any character including
       *  a space or a newline character).
       *  @return character read or <code>null</code> character
       *  (Unicode 0) if trying to read beyond the EOF
      public char readChar()
        char ch = '\u0000';
        try
          if (ready())
             ch = (char)myInFile.read();
        catch (IOException e)
          if (myFileName != null)
            System.err.println("Error reading " + myFileName + "\n");
          myErrorFlags |= READERROR;
        if (ch == '\u0000')
          myErrorFlags |= EOF;
        return ch;
       *  Reads from the current position in the file up to and including
       *  the next newline character.  The newline character is thrown away
       *  @return the read string (excluding the newline character) or
       *  null if trying to read beyond the EOF
      public String readLine()
        String s = null;
        try
          s = myInFile.readLine();
        catch (IOException e)
          if (myFileName != null)
            System.err.println("Error reading " + myFileName + "\n");
          myErrorFlags |= READERROR;
        if (s == null)
          myErrorFlags |= EOF;
        return s;
       *  Skips whitespace and reads the next word (a string of consecutive
       *  non-whitespace characters (up to but excluding the next space,
       *  newline, etc.)
       *  @return the read string or null if trying to read beyond the EOF
      public String readWord()
        StringBuffer buffer = new StringBuffer(128);
        char ch = ' ';
        int count = 0;
        String s = null;
        try
          while (ready() && Character.isWhitespace(ch))
            ch = (char)myInFile.read();
          while (ready() && !Character.isWhitespace(ch))
            count++;
            buffer.append(ch);
            myInFile.mark(1);
            ch = (char)myInFile.read();
          if (count > 0)
            myInFile.reset();
            s = buffer.toString();
          else
            myErrorFlags |= EOF;
        catch (IOException e)
          if (myFileName != null)
            System.err.println("Error reading " + myFileName + "\n");
          myErrorFlags |= READERROR;
        return s;
       *  Reads the next integer (without validating its format)
       *  @return the integer read or 0 if trying to read beyond the EOF
      public int readInt()
        String s = readWord();
        if (s != null)
          return Integer.parseInt(s);
        else
          return 0;
       *  Reads the next double (without validating its format)
       *  @return the number read or 0 if trying to read beyond the EOF
      public double readDouble()
        String s = readWord();
        if (s != null)
          return Double.parseDouble(s);
          // in Java 1, use: return Double.valueOf(s).doubleValue();
        else
          return 0.0;
    }same with this:
    public class p
         public static void l(String S)
          { System.out.println(S);}
         public static void o(String S)
          {System.out.print(S);}
         public static void l(int i)
          { System.out.println(i);}
         public static void o(int i)
          {System.out.print(i);}
         public static void l(boolean b)
          { System.out.println(b);}
         public static void o(boolean b)
          {System.out.print(b);}
        public static void l(char c)
          { System.out.println(c);}
         public static void o(char c)
          {System.out.print(c);}     
         public static void l(double d)
          { System.out.println(d);}
         public static void o(double d)
          {System.out.print(d);} 
        public static void l(Object obj)
          { System.out.println(obj.toString());}
         public static void o(Object obj)
          {System.out.print(obj.toString());}
         public static void l()
          {System.out.println();}
    }       here's my code:
    import java.util.*;
    public class JMM_Pig
         public static void main(String[] args)
              int winner=0;
              int pts=0;
                   JMM_Dice player1=new JMM_Dice();
                   JMM_Dice player2=new JMM_Dice();
                   p.l("Player 1 rolls the dice...");
                   player1.rollDice();
                   player1.updateTotals();
                   boolean loop=true;
                   while(loop)
                   while(player1.numVowels()<=4)
                        p.l("Player 1 continues his turn...");
                        player1.rollDice();
                        player1.updateTotals();
                        p.l("Player 1 rolled a "+player1.getDie1()+" and a "+player1.getDie2()+" and a '"+player1.getDie3()+"' and a '"+player1.getDie4()+"'");
                        p.l("Player 1 rolled "+player1.currvowels()+" vowels.");
                        p.l("Player 1 has "+player1.totalvowels()+" total vowels.");
                        //if(player1.getMagic()==1)
                        //player1.totalPoints=(player1.totalPoints+player1.getDie1()+player1.getDie2())*player1.mult;
                        //pts=(player1.totalPts()+player1.getDie1()+player1.getDie2())*player1.getMult();
                        //player1.setTpts(pts);
                        //if(player1.getMagic()!=1)
                             //player1.totalPoints=player1.totalPoints+player1.getDie1()+player1.getDie2();
                        //pts=player1.totalPts()+player1.getDie1()+player1.getDie2();
                        //player1.setTpts(pts);
                        p.l("Player 1 has "+player1.numSnakes()+" snake eyes.");
                        p.l("Player 1 earned "+player1.ptsreturn()+" points this turn.");
                        p.l("Player 1 has "+player1.totalPts()+" total points.");
                        pts=0;
                        if(player1.totalPts()>=2000)
                             winner=1;
                             player1.setNv(4);loop=false;
                        if((player1.isavowel(player1.getadice()))&&player1.isavowel(player1.getadice2()))
                             player1.setTpts(0);player1.setNv(0);player1.setNv(4);
                   p.l("Player 1's turn has ended...");
                   player1.setNv(0);
                   p.l("Player 2 rolls the dice...");
                   player2.rollDice();
                   player2.setTpts(player2.totalPts()+player2.getDie1()+player2.getDie2());
                   while(player2.numVowels()<=4)
                        p.l("Player 2 continues his turn...");
                        player2.rollDice();
                        player2.updateTotals();
                        p.l("Player 2 rolled a "+player2.getDie1()+" and a "+player2.getDie2()+" and a '"+player2.getDie3()+"' and a '"+player2.getDie4()+"'");
                        p.l("Player 2 rolled "+player2.currvowels()+" vowels.");
                        p.l("Player 2 has "+player2.totalvowels()+" total vowels.");
                        //if(player1.getMagic()==1)
                        //player1.totalPoints=(player1.totalPoints+player1.getDie1()+player1.getDie2())*player1.mult;
                        //pts=(player1.totalPts()+player1.getDie1()+player1.getDie2())*player1.getMult();
                        //player1.setTpts(pts);
                        //if(player1.getMagic()!=1)
                             //player1.totalPoints=player1.totalPoints+player1.getDie1()+player1.getDie2();
                        //pts=player1.totalPts()+player1.getDie1()+player1.getDie2();
                        //player1.setTpts(pts);
                        p.l("Player 2 has "+player2.numSnakes()+" snake eyes.");
                        p.l("Player 2 earned "+player2.ptsreturn()+" points this turn.");
                        p.l("Player 2 has "+player2.totalPts()+" total points.");
                        pts=0;
                        if(player2.totalPts()>=2000)
                             winner=2;
                             player2.setNv(4);loop=false;
                        if((player2.isavowel(player2.getadice()))&&player2.isavowel(player2.getadice2()))
                             player2.setTpts(0);player2.setNv(0);player2.setNv(4);
                   p.l("Player 2's turn has ended...");
                   player2.setNv(0);
                   if(player1.totalPts()>=2000)
                        winner=1;
                        loop=false;
                   if(player2.totalPts()>=2000)
                        winner=2;
                        loop=false;
                   }  //main loop
                   if(winner==1)
                        p.l("It ended with the following statistics...");
                        p.l("Player 1's score was: "+player1.totalPts()+" and Player 2's score was: "+player2.totalPts());
                        p.l("Player 1 had: "+player1.numSnakes()+" snake eye(s) and Player 2 had: "+player2.numSnakes()+" snake eye(s)");
                        p.l("Player 1 wins, oink oink!");
                   if(winner==2)
                        p.l("It ended with the following statistics...");
                        p.l("Player 1's score was: "+player1.totalPts()+" and Player 2's score was: "+player2.totalPts());
                        p.l("Player 1 had: "+player1.numSnakes()+" snake eye(s) and Player 2 had: "+player2.numSnakes()+" snake eye(s)");
                        p.l("Player 2 wins, oink oink!");
    and dice class:
    import java.util.*;
    public class JMM_Dice {
         private static Random gen = new Random();
        private final static int NUM_SIDES = 21;
        private int die1, die2, numSnakeEyes, numVowels, totalPoints;
        private char die3, die4;
        private int dice=0;
           //dice=
           private int dice2=0;
           //dice2=;
           private String adice="";
           //adice=;
           private String adice2="";
           //adice2;
           private int magic=0;
           private int mult=0;
           private int currvowels=0;
           private int totalvowels=0;
      public static EasyReader key = new EasyReader();
      public JMM_Dice()
          dice=0;dice2=0;
           String alpha="abcdefghijklmnopqrstuvwxyz";
          adice="";adice2="";
           rollDice();
           numSnakeEyes=0;numVowels=0;totalPoints=0;
      public void setTpts(int tpts)
           this.totalPoints=tpts;
      public void setNv(int nv)
           this.numVowels=nv;
      public int getDie1()
           return dice;
      public int getDie2()
           return dice2;
      public String getDie3()
           return adice;
      public String getDie4()
           return adice2;
      public int numSnakes()
           return numSnakeEyes;
      public void setSnakes(int s)
           this.numSnakeEyes=s;
      public String getadice()
           return this.adice;
      public String getadice2()
           return this.adice2;
      public int numVowels()
           return numVowels;
      public int getMagic()
           return this.magic;
      public int getNv()
           return this.numVowels;
      public void setMagic(int mag)
           this.magic=mag;
      public int getMult()
           return this.mult;
      public void setMult(int m)
           this.mult=m;
      public int totalPts()
           return totalPoints;
      public String toString()
           return dice+""+dice2+""+adice+""+adice2;
      public boolean isavowel(String str)
           if(str.equals("a")||str.equals("e")||str.equals("i")||str.equals("o")||str.equals("u"))
                return true;
           else
                return false;
      public int ptsreturn()
           return dice+dice2;
      public int currvowels()
           int tmp=currvowels;
           currvowels=0;
           return tmp;
      public int totalvowels()
           return numVowels;
      public void updateTotals()
           if(adice.equalsIgnoreCase("a")||adice.equalsIgnoreCase("e")||adice.equalsIgnoreCase("i")||adice.equalsIgnoreCase("o")||adice.equalsIgnoreCase("u")||adice2.equalsIgnoreCase("a")||adice2.equalsIgnoreCase("e")||adice2.equalsIgnoreCase("i")||adice2.equalsIgnoreCase("o")||adice2.equalsIgnoreCase("u"))
                numVowels++;currvowels++;
           if((isavowel(adice))&&isavowel(adice2))
                totalPoints=0;numVowels=0;
           if(dice==1||dice2==1)
                numSnakeEyes++;
           int fd=dice;
           int sd=dice2;
           int sum=fd+sd;
           totalPoints+=sum*(numSnakeEyes+1);
      public void rollDice()
           dice=gen.nextInt(20)+1;
           dice2=gen.nextInt(20)+1;
           String alpha="abcdefghijklmnopqrstuvwxyz";
           adice=String.valueOf(alpha.charAt(gen.nextInt(26)));
           adice2=String.valueOf(alpha.charAt(gen.nextInt(26)));
      public static void sleep (int wait)
      {     long timeToQuit = System.currentTimeMillis() + wait;
           while (System.currentTimeMillis() < timeToQuit)
                ;   // take no action
    }the program works fine except it's supposed to terminate when one of the two AIs get a score of 2000, right now it terminates no matter what score the AIs get and no matter what I've tried to do it keeps doing that...can someone please tell me why it's terminating so oddly? Thanks! :)

    Here's how my code works in a nutshell, the main program starts with the boolean loop=true;
                   while(loop)
                   {then comes the loops for the two AIs, first the player 1 AI goes with this loop: while(player1.numVowels()<=4)
                   {there the player 1 roles the dice and it keeps going until player 1 gets a total of 2000 points at which time this is supposed to execute: if(player1.totalPts()>=2000)
                             winner=1;
                             player1.setNv(4);loop=false;
                        }, player1.setNv(4); sets numVowels to 4 so that the inner loop exits, loop=false exits the other loop and winner=1; specifies that player 1 won which is used outside of the loops here: if(winner==1)
                        p.l("It ended with the following statistics...");
                        p.l("Player 1's score was: "+player1.totalPts()+" and Player 2's score was: "+player2.totalPts());
                        p.l("Player 1 had: "+player1.numSnakes()+" snake eye(s) and Player 2 had: "+player2.numSnakes()+" snake eye(s)");
                        p.l("Player 1 wins, oink oink!");
                   if(winner==2)
                        p.l("It ended with the following statistics...");
                        p.l("Player 1's score was: "+player1.totalPts()+" and Player 2's score was: "+player2.totalPts());
                        p.l("Player 1 had: "+player1.numSnakes()+" snake eye(s) and Player 2 had: "+player2.numSnakes()+" snake eye(s)");
                        p.l("Player 2 wins, oink oink!");
                   } the same thing happens for player 2 if player 1 didn't already get 2000 points...but the if statement despite everything pointing to the variables containing the right values don't seem to be working, as shown by the example program output I posted it just ends at any random number...hopefully this helps make figuring out what's wrong easier :) ...so can anyone please help me out? thanks! :)

  • Please Help! Problems with Windows Vista 32-bit on Boot Camp (Wireless/Etc)

    We recently purchased a new aluminum Mac Book (13 inch) with Leopard (10.5.4). I attempted to install Boot Camp and Windows Vista 32-bit. I can successfully alternate between both operating systems with no problems. However, I am having 2 problems:
    1) I cannot connect to wireless internet. No connections will even show up when I attempt to connect, its almost as if an adapter hasn't been installed.
    2) I cannot set up the trackpad to do right click.
    I've read articles everywhere and nothing has helped. Can anybody please help me??? Any support/advice is greatly appreciated. Thanks in advance!
    - Pierce

    dpierceNKC:
    Welcome to the Apple discussions.
    It appears that you may not have installed the boot camp drivers. Boot into Windows and insert your Leopard installation disk in the CD/DVD drive. This should automatically begin installation of the necessary drivers. Reboot the computer when instructed and all the hardware should work as designed.
    The right click is accomplished by placing two fingers on the trackpad and then depressing the trackpad button. This should also work after the drivers are installed as instructed above.
    Axel F.

  • Please Help Printer Problems

    I have just bought an Airport Extreme Base Station. I have a Mac Book, iBook G3 and a Win XP Laptop that I have so far connected to the network.
    On the base station itself I have a Western Digital My Book External Hard Drive and an HP Photosmart C4180 all in one printer connected via a USB hub.
    All the computers can see the external hard drive but I can only get the Win XP Laptop to print. The two Apple laptops will not print.
    One last thing all my computers connected to the internet wirelessly via my BT Fusion Home Hub before buying the base station. When I first installed the base station I connected the WAN port to the BT hub. As far as the base station is telling me everything must be setup right as I have the solid green light.
    What am I doing wrong. Please help I love Apple products and really do not want to send this back.

    I'd like to suggest you go to www.tune-up.com and download and install this program.
    You get a 30 day free trial to start. If you sign up as a reseller you can get the program for $29 after that.
    I'm not an employee of the company but I just recommend the program as it has fixed many a friends
    problems and has kept my computers and my familys computers running straight and clean with no problems.
    Even if you don't buy the program after using it and it fixes your problems you can uninstall it and consider it a blessing.
    I'm sure once you see what it can do you will think twice to buy it.
    Other than that, I don't know much about your system to even begin to try to tell you what to do as a troubleshooter.
    It could be any number of things that are wrong with it. Number one, the registry might be really messed up.
    Tune-up will fix that fix off for you. A computer is like a car, it has to be kept in tune in order to keep running right.
    Another problem area is malware and viruses. We all know about them but do we ever really know if we might have been bit
    by any of them. Most times not until something serious causes us problems. Can I suggest another program you might try?
    AVG Internet Security 2011 at www.avg.com.  It's another 30 day free trial program. I am also a reseller and have all my computers
    and family members registered and using it.
    I can tell you that with only these two programs installed on your computer you can rest easy and use your computer without any fears or problems.    Let me know how it goes for you. Good luck.
    Paul Streicher
    Tampa, FL

  • Please Help java.policy signedBy can't access file local

    i create keystore and signjar in web applet
    run tomcat access file in local but not acess file denied
    i goto edit file java.policy
    grant {
         permission java.security.AllPermission;
    can access file
    but put SignedBy cannot access file
    grant SignedBy fuangchai{
         permission java.security.AllPermission;
    Please help me example file keystore,applet.jar,java.policy
    to signedby access file local in webapplet
    env JDE 1.5 ,javascript yui 2.8 ,prototype js,tomcat6
    File html
    <object classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"
    codebase="http://java.sun.com/update/1.5.0/jinstall-1_5-windows-i586.cab#Version=5,0,0,5"
    width="1" height="1" >
    <param name=code value="com.arg.aes.test.FileDirectoryBS.class" >
    <param name=archive value="app.jar">
    <param name=codebase value="." >
    <param name="type" value="application/x-java-applet;version=1.5">
    <param name="scriptable" value="true">
    <param name="mayscript" value="true">
    <param name="debug" value="false">
    <comment>
    <embed name="myApplet" id="myApplet"
    type="application/x-java-applet;version=1.5"
    code="com.arg.aes.test.FileDirectoryBS.class"
    archive="app.jar"
    java_codebase="."
    width="1"
    height="1"
    scriptable="true"
    mayscript="true"
    pluginspage="http://java.sun.com/products/plugin/index.html#download">
    <noembed>
    </noembed>
    </embed>
    </comment>
    </object>
    <applet
    code="com.arg.aes.test.FileDirectoryBS"
    width="1"
    height="1"
    archive="app.jar"
    name="myApplet"
    codebase="."
    MAYSCRIPT="true"
    >
    </applet>
    javascript
    initlistfile : function() {
              try
                   var list = $("myApplet").initlistfileInDir();     
                   var jsondata = list.evalJSON();
                   /*alert(jsondata.dirname);
                   alert(jsondata.dirpath);
                   alert(jsondata.listfile.length);*/
                   initTableLeft(jsondata.listfile);
              catch(e)
                   alert("Exception : access denied.");
                   return;
    import java.applet.Applet;
    import java.io.File;
    import java.security.Permission;
    import java.security.PermissionCollection;
    import java.security.Policy;
    import java.security.ProtectionDomain;
    import java.text.DecimalFormat;
    import java.text.NumberFormat;
    import java.util.ArrayList;
    import java.util.Enumeration;
    import java.util.List;
    * @author fuangchai
    public class FileDirectoryBS extends Applet{
    public static File[] ROOTS = File.listRoots();
    public static String HOME = System.getProperty("user.home");
    public String listDir()
    return JsonObj.makeTopDir((ROOTS.length > 0)?ROOTS : new Object[]{HOME});
    public String initlistfileInDir()
    return listfileInDir(null);
    public String listfileInDir(String dirName)
    if(null == dirName || dirName.equals(""))
    System.out.println("root = " + ROOTS.length);
    try {
    dirName = (ROOTS.length > 0)?ROOTS[0].getPath():HOME;
    catch (Exception e) {
    e.printStackTrace();
    return "";
    System.out.println("#########################");
    DirectoryDescImp obj = makeObjDir(dirName);
    return (null == obj)?null:JsonObj.makeDir(obj);
    public String listlinkInDir(String dirName)
    if(null == dirName || dirName.equals(""))
    System.out.println("root = " + ROOTS.length);
    try {
    dirName = (ROOTS.length > 0)?ROOTS[0].getPath():HOME;
    catch (Exception e) {
    e.printStackTrace();
    return "";
    System.out.println("#listlinkInDir#");
    try {
    File obj = new File(dirName);
    return (null == obj)?null:JsonObj.makelinkDir(obj.getName(),obj.getPath());
    } catch (Exception e) {
    System.out.println("I can't access a file here! Access Denied!");
    e.printStackTrace();
    return null;
    public boolean isEnc(File f)
    //TODO
    return false;
    public DirectoryDescImp makeObjDir(String dirName)
    System.out.println("dirName = " + dirName);
    try{
    File dir = new File(dirName);
    String[] entries = dir.list();
    if(null == dir || null == entries || entries.length <= 0)
    System.out.println("Data is null or not obj." );
    return null;
    System.out.println("Dir List = " + dir.list().length);
    System.out.println("Dir Name = " + dir.getName());
    System.out.println("Dir Path = " + dir.getPath());
    DirectoryDescImp dirDesc = new DirectoryDescImp();
    dirDesc.setDirName(dir.getName());
    dirDesc.setDirPath(dir.getPath());
    List<FileDescImp> list = new ArrayList<FileDescImp>();
    for(int i=0; i < entries.length; i++) {
    File f = new File(dir, entries);
    FileDescImp fDesc = new FileDescImp();
    fDesc.setFile(f);
    fDesc.setFileEncrept(isEnc(f));
    list.add(fDesc);
    dirDesc.setListfile(list);
    return dirDesc;
    catch(Exception e){
    System.out.println("I can't access a file here! Access Denied!");
    e.printStackTrace();
    return null;
    Thank you
    Fuangchai Jum
    Mail [email protected]
    Edited by: prositron on Jan 13, 2010 7:35 AM

    OK,
    Let's say I have to intialize Environment, and call method initEnvironment() in Applet's init(). Environment class:
    class Environment
         private KeyStore keyStore;
         private Enumeration<String> aliases;
         public void initEnvironment() {
              Security.addProvider(new sun.security.mscapi.SunMSCAPI());
              keyStore = KeyStore.getInstance("Windows-MY");
              keyStore.load(null);
              aliases = keyStore.aliases();
    }Applet is signed, I trust signer.
    Since Applet is signed I'm able to overwrite existing .java.policy under user.home.
    This doesn't work if I don't have .java.policy:
    grant {
      permission java.security.SecurityPermission "insertProvider.SunMSCAPI";
      permission java.security.SecurityPermission "authProvider.SunMSCAPI";
      permission java.util.PropertyPermission "jsr105Provider", "read";
      permission java.util.PropertyPermission "com.sun.xml.internal.ws.api.pipe.Fiber.serialize", "read";
      permission java.lang.RuntimePermission "setContextClassLoader";
      permission java.util.PropertyPermission "com.sun.xml.internal.ws.api.streaming.XMLStreamWriterFactory.noPool", "read";
      permission java.lang.RuntimePermission "accessDeclaredMembers";
      permission java.lang.reflect.ReflectPermission "suppressAccessChecks";
      permission java.lang.RuntimePermission "accessClassInPackage.com.sun.xml.internal.ws.fault";
      permission java.util.PropertyPermission "com.sun.xml.internal.ws.api.streaming.XMLStreamWriterFactory.woodstox", "read";
    };P.S.
    Does it make sense to be able to make changes to file system and not be able to make actions from above policy?!?!

  • Please Help, Mobo problems

    Hello all, i have the new K8N neo platinum nforce3 motherboard and it has been working fine up until today when i attempted to install a stick of 256mb of PC2700 memory.  After i installed the memory properly, i attempted to boot up my computer and i got the Diagnostic Sound of RAM problem.  Nothing is showing up on my screen so i cant enter BIOS or CMOS.  Please help i need my computer back asap  

    I cannot even get into BIOS.  I boot up and get a blank screen and the diagnostic sound   So tried to reset the jumper and that didnt work...my only other solution is that i get a few sticks of PC3200 memory.  Another suggestion i hvae recieved was that i fractured my motherboard.   Possibly a little hairline fracture in my motherboard that would render it useless.  But why would my motherboard turn on if it was fractured? doesnt make sense.  Computer powers on, but no visual on the screen and Diagnostic sound indicating a RAM problem.

  • Please help username problems!

    My blackberry curve9300 has a username attached to the device which isnt even a email address so i cant change it! I have tried accessing my blackberry id to update my apps but i cant as my username is incorrect! I have created a new blackberry id on my laptop but my blackberry wont accept it as it isnt linked to my device! please help i will be eternally grateful!

    Hi casharding 
    Welcome to BlackBerry Support Forums
    We Can reset our BBID password and even the Username , but if the username or the email is incorrect or invalid then you have very limited Options. Have to create a new BlackBerry ID but in this process you will loose access to any of your paid apps.
    Changing the BlackBerry ID on web itself will solve this issue.So first do a Backup of your device using Desktop Software or refer to this helpful article : How To Backup Your BlackBerry
    When you are done follow this Knowledege Base to resolve the issue:
    KB26694 : How to change the BlackBerry ID on a BlackBerry PlayBook tablet or BlackBerry smartphone.
    Try it and let us know of your progress.
    Click " Like " if you want to Thank someone.
    If Problem Resolves mark the post(s) as " Solution ", so that other can make use of it.

  • Please help Install problems

    I boot from CD run through the sun boot part ok.
    Then i select to boot from my CD at the end. THis works fine.
    It then starts to load sunOs 2.8 but restarts very shortly after and does'nt give me a chance to read error message.
    I tryed loads of different configs with no sucess Please help.
    The system i run is a p4 wit intels G850GB Mainboard geforce2, 128MB PC 800

    P4, seems not supported yet. Try to look into the
    Solaris Intel forum next to this. Some discussions
    about P4 already. Maybe you will find what you want.Indeed.
    Have a look at
    http://groups.google.com/groups?q=solaris+p4+setup_mca+kadb&hl=en&lr=&safe=off&site=groups
    these usenet articles give a procedure to boot solaris 8
    on a P4 cpu.
    Once you've got the system installed using the kadb
    procedure given above you should try to install the latest
    kernel patch 108529-08 that fixes problem solaris has with
    these P4 cpus.

  • Please Help, Numerous Problems

    Had a problematic iPod not being recognized by windows, resetted, remformmated everything. Sent it back, got a new one. reinstalled itunes, reinstalled ipod update, same problem. Only now, it's stuck on do not disconnect whenever plugged in and whenever not plugged in displays the exclamation and folder with www.apple.com/ipod/support written underneath. Please help me, i am really upset as I have been having these problems for a long time

    Well, I've now gotten back to the point where it's the iTunes problem again, my pc recognizes that my ipod is plugged in, but iTunes doesn't. And I tried updating the software, but it says that the ipod isn't supported.
    I guess this makes me more certain that I'm going to switch to OS X and get a powerbook. I highly doubt that Macs have these problems with ipods. I guess I could get mad at Apple and say it's their fault, but my guess is it's a software issue, one relating to XP, oh well.

  • PLEASE, PLEASE HELP: Big problems with my Zen Touch. (Firmware/driver issu

    So here's the deal:
    Last night I thought I'd finally take the time to upgrade my Zen Touch to 2. from .3 or something like that. I noticed that there was a warning saying that this was no small upgrade, and that I should back up everything I have on it.
    I'm glad I did, because now my MP3 player situation is seriously screwed up, big time. During the upgrade process, my computer froze, leaving my Zen Touch without firmware (ok, so firmware version 0.0.0). Upon turning the device on, it boots up in recovery mode. This allows me to either format, clean up, or "reupload" firmware. I've tried all of these options, but the fact is clear that my computer simply will no longer recognize my MP3 player.
    It does, however, recognize it at as a generic storage device. However, this isn't enough for me to reinstall the player's firmware unfortunately.
    So basically, I can't update driver or firmware right now, because my computer won't acknowlege my Zen Touch!
    Somebody please, please help.
    I've already tried using the setup file from http://www.jumpingcholla.com/jce_nomad_ZEN.htm.
    Seriously, please help!

    Sort of success!
    I now finally have firmware 2. installed on my Zen Touch! Yeah! I'm not entirely sure how I did it, and I'm not bothering to find out, I'm just glad I finally got it on there.
    But some problems still remain. After all this fiddling with my driver and firmware and whatnot, my computer just doesn't see my MP3 the same way as it used to. Before, it was great, all I had to do was plug her in and I could bring up Zen Explorer in Windows Explorer, or organize my stuff in Creative MediaSource.
    Now that's not the case. The only way I can sort of add stuff to my player now is by going into Windows Explorer, which is still more or less acknowleging my player as a "portable device". Granted, there is a dri've called "My Zen", but it doesn't bring up Zen Explorer like it used to when I click on it. Furthermore, when I go into MediaSource, I can't select it as a location, there just isn't anything there.
    It almost seems as if my computer thinks I'm just using a portable hard dri've. Is there anyway I can tell it that it's an MP3 player, too?
    Thanks!

  • Boot Camp Issue (Please Help, Massive Problem)

    Okay here's the deal...
    Installed Boot Camp fine
    I'm trying to install online updates and mcafee for msn
    after like 2 min a blue screen flashes and mac restarts
    when windows comes back it say check hard disk
    and say this is a fat 32.
    then it runs through some files and says there not valid
    and windows then corrects them...it puts me back to the welcome screen and i try again and the same thing happens.
    Ps. dos my display have anything to do with it cuz everytime it starts up it says it detects a tv display i just close it and move on but i did make sure it wasn't on tv first
    please help i need windows for a program for school thats it a working boot camp would make it a whole lot easier

    Did you make sure to declare you C: drive during the BootCamp setup process?
    I had no problems with my BootCamp, XP, and Virus Protection installation.

  • Please help! Problem playing film on PC!

    When I edited the project I worked in two sequences for a while, but copied everything in the first sequence onto a new sequence and deleted the first sequence. It seems like this is why the film can't be shown on a PC or be uploaded to Youtube. It seems fine when I play the Quicktime on the Mac the film was edited, but it doens't work anywhere else.
    None of the formats want to play on PC. The film only works on the Mac the film was edited. Unfortunately I don't have the Mac where the film was edited here now, but when I try to open the Quicktime on my PC I get this message: "The sequence 1-FIN-00000018 can't be found. The film can't be played without this sequence". That happened on another PC aswell. Someone suggested that I've exported a reference movie from FCP and not a self-contained file. Does anyone know how I can solve this?
    Please help!!!
    Thank you!

    >Someone suggested that I've exported a reference movie from FCP and not a self-contained file.
    They are right. The clue here is "reference", the file refers back to the content of other files. If those files are missing, your movie is worthless.
    >Does anyone know how I can solve this?
    Go back to the Mac where your project was made and export a self-contained move that uses a common codec such as H.264.

Maybe you are looking for

  • Why does it lag so much when I scroll in Safari? (OS X Lion)

    I've noticed that ever since the OS X Lion update, webpages in general are pretty laggy when scrolling.  I let the page completely load and when I scrollthere is stuttering and lag.  It is made most apparent when I use momentum to scroll a long webpa

  • Cannot activate office 365 after latest upgrade

    Having downloaded the latest Yosemite  0.1 upgrade  I cannot activate Office 365 . Anyone else having this problem?

  • MS-OFFICE interface in FORMS6i

    I would like to do the following : 1. Create a MS-Word document with certain field in the doc template filled up from database on Click of button in Forms6i web solution. IS IT POSSIBLE to call MS_OFFICE Products from FORMS6i web deployment?. VERY UR

  • How do I import/drag a downloaded template with 2 folders, PSD and HTML into GoLive 7?

    The index page looks fine in Preview but broken up in Layout. I tried the Import feature, and dragging the folders and files that came with the template into a new site. No luck. THANKS

  • Unable to open tomcat

    I have BOE XI 3.1 with SP2 installed on Windows Server 2008 (64 bit). I have both CMC & Infoview working. I am trying to open Tomcat Configuration to set up SSO, but it is giving an error message, "Access is denied. Unable to open the service 'BOE120