Int to String - Help Please

Hi !
I want to write a function to translate numbers between 0-19 to letters a-t
Can u Help me ???

Even easier.... Just add 97 each time to your number and type cast it as a char. 97 is the int value of 'a'
int mynumber = 0;   // put your number here
System.out.println((char)(mynumber + 97));

Similar Messages

  • Unsatisfied link when callind dll from run method Help Please?

    Hi,
    I get an unsatisfied link error while trying to calling a dll at a certain time period in a run method. The same dll works fine called in another setup and even called in a loop.
    Can anyone help please?
    import java.util.Timer;
    import java.util.TimerTask;
    * Schedule a task that executes once every second.
    public class TimeRetrieve {
        Timer timer;
        public TimeRetrieve() {
                 timer = new Timer();
            timer.schedule(new RemindTask(),
                        0,        //initial delay
                        1*1000);  //subsequent rate
        class RemindTask extends TimerTask
           String string_A;
           double d1;
         double d2;
         double d3;
         double d4;
         double d5;
         double d6;
         double d7;
         double d8;
         int numIter = 3;
         int start = 1;
            public void run()
                  if (numIter > 0) {
                  cinterface(start, string_A, d1, d2, d3, d4, d5, d6, d7, d8 );
              System.out.println("In Java action performed start button, after call to dll  \n");
              System.out.println("   string_A =  :" +string_A );
              System.out.println("doubles , \t  d1  \t d2  \t  d3  \t d4 \t d5 \t d6 \t d7 \t d8");
              System.out.println(d1 +"\t" +d2+"\t"+d3+"\t"+d4+"\t"+d5+"\t"+d6+"\t"+d7+"\t"+d8);
              numIter--;
                 } else
                 System.out.println("End Looping!");
                    System.exit
                 System.exit(0);  
        public static void main(String args[]) {
                   System.out.println("Starting Data Retrieval.");
                 new TimeRetrieve();
    // Load shared library which contains implementation of native methods
                    public native void cinterface(int start, String string_A, double d1, double d2, double d3, double d4,
                    double d5, double d6, double d7, double d8 );
                    static
                          try
                               System.out.println ("load cinterface"); //unsatisfied link
                               System.loadLibrary("cinterface");
                          catch (UnsatisfiedLinkError ee)
                               System.out.println
                                    ("Caught unsatisfied link error for dlls" );
                               System.out.println
                                    ("get local msg = " + ee.getLocalizedMessage() );
                               System.out.println ("getMessage " + ee.getMessage() );
                                   // System.out.println ("print Stack Trace " +ee.printStackTrace() );

    My mistake! I found it. Had some wrong names.

  • Help Please - Landscape Printing in JDK1.3

    Iam trying to print a line of text of 160 chars wide in landscape
    format. The ImageableWidth and ImageableHeight are 792 and 612
    respectively. The ImageableX and ImageableY are both 72(1 inch).
    Font -> ("Courier", Font.PLAIN, 7),
    noOfChars/line -> 162 for the Imageable area 792 x 612
    But after printing I could see the line starting after 2 inches
    as Right Margin, because of which, I'm not able to print the
    complete 160 char line.
    I set the value posX=0 to start after 1 inch, but still the printing
    starts only after 2 inches but initial few chars are eaten.
    when posX = 72
    <- 2" R Margin ->0123456789 0123456789 .... 154th char
    when posX = 0
    <- 2" R Margin ->56789 0123456789 ....... 160th char
    please help.
    lenin.
    import java.util.*;
    import java.awt.*;
    import java.awt.print.*;
    public class Printer implements Printable {
         public int print(Graphics g, PageFormat format, int pageIndex) {
         String content = "0123456789 0123456789 0123456789 " +
              "0123456789 0123456789 0123456789 " +
              "0123456789 0123456789 0123456789 " +
              "0123456789 0123456789 0123456789 " +
              "0123456789 0123456789 0123456789 012345";
         int totalWidth = (int) format.getImageableWidth();
         int totalHeight = (int) format.getImageableHeight();
         System.out.println("ImageableWidth : " + totalWidth);
         System.out.println("ImageableHeight : " + totalHeight);
         int posX = (int) (format.getImageableX());
         int posY = (int) (format.getImageableY());
         posY += 20;
         System.out.println("PosX : " + posX);
         System.out.println("PosY : " + posY);          
         pageIndex++;
         FontMetrics fontMetrics =
    g.getFontMetrics(new Font("Courier", Font.PLAIN, 7));
         int charWidth = fontMetrics.stringWidth("W");
         int charHeight = fontMetrics.getHeight() + 1;
         int noOfLines = Math.round(totalHeight / charHeight);
         int noOfCharsPerLine = Math.round(totalWidth / charWidth);
         System.out.println("No Of Lines : " + noOfLines);
         System.out.println("No Of Char/Line : " + noOfCharsPerLine);
         if (pageIndex > 0) {
         g.setFont(new Font("Courier", Font.PLAIN, 7));
         g.drawString(content, posX, posY);
         return 0;          
         public static void main(String args[]) {
              Printer myPrinter = new Printer();
              PrinterJob job = PrinterJob.getPrinterJob();
              PageFormat pageFormat = job.defaultPage();
              pageFormat.setOrientation(PageFormat.LANDSCAPE);
              Book book = new Book();          
              book.append(myPrinter,pageFormat);          
              job.setPageable(book);
              if (job.printDialog()) {
                   try {
                        job.print();
                   catch (Exception e) {
                        e.printStackTrace();
              System.exit(0);

    Hi,
    I'm developing a report program with java and I want to print this report.
    These are my page settings:
    paper.setSize(594.936, 841.536);
    paper.setImageableArea(0,0,594.936, 841.536)
    and my print method includes :
    Graphics2D g2d = (Graphics2D) g;
    g2d.translate(pageFormat.getImageableX(), pageFormat.getImageableY());
    but I can't use the page effectively. I have 28 mm blank from the left and 13 mm blank from the right.
    I can't write anything this blank sections. It looks as if it was deleted.
    What should I do?
    Thank you very much for your help.

  • Pattern and Matcher problem. Help Please!

    I am trying to make the user enter a correct US$ in HTML(jsp format) ie 12.34 but not 12.3456. As far as i know, the regular expression below is correct for $$.
    but the there is no error even if the user types 12.34567
    can anyone help me please?
    this is the code i wrote...
    public static final int DATA_ENTRY = 1;
    public static final int INVALID_CURRENCY = 2;
    public static final int PROCESS_INPUT = 3;
    int state;
    String a; //data input from user
    Pattern p = Pattern.compile("\\d{1,3}(?:(?:,\\d\\d\\d)*|\\d*)(?:\\.\\d\\d)?");
    Matcher m = p.matcher(a);
    state = DATA_ENTRY; // this is default
    if (m.find() {
         state = PROCESS_INPUT;
    else {
         state = INVALID_CURRENCY;

    Here's two pattern strings that both require a two-place fraction for each entry but do not permit more than two places.
    import java.util.regex.*;
    public class snggun {
      public static void main(String[] args) {
        String input = (args.length > 0 ? args[0] : "10.00");
    //    String mask = "\\d{1,3}(?:(?:,\\d\\d\\d)*|\\d*)(?:\\.\\d\\d)?";
        // requires two-place fraction
    //    String mask = "^(\\d{1,3})(,(\\d\\d\\d))*(\\.\\d\\d)\\z";
        // requires two-place fraction
        String mask = "\\d{1,3}(?:(?:,\\d{3})*|\\d*)(\\.\\d{2})\\z";
        Pattern pattern = Pattern.compile(mask);
        Matcher match = pattern.matcher(input);
        System.out.println("input = " + input + " qualifies " + match.find());
        if(match.find())
          for(int j = 0; j <= match.groupCount(); j++)
            System.out.println("group " + j + "  " + match.group(j));
    }

  • Iterating through results help please

    H i have a Mysql database that contains and ID and a rating. I would like to iterate through the results of the query and display a number of stras that relates to the rating.
    JSP page code:
    <%@ page contentType="text/html; charset=utf-8" errorPage="errorPage.jsp" language="java" import="java.sql.*" import="java.util.Date.*" %>
    <%@ page language="java" import="java.sql.*" %>
    <%!
    // define variables
    String portfolio_id;
    int p_rating;
    String conn;
    %>
    <%
    Class.forName("com.mysql.jdbc.Driver");
    //get parameter to search by
    //String modelNO = request.getParameter("model_number");
    // create connection string
    //jdbc:mysql://host_name:port/dbname - MySQL Connector/J JDBC Driver.
    conn = "jdbc:mysql://server/md_portfolio?user=user&password=password";
    // pass database parameters to JDBC driver
    Connection Conn = DriverManager.getConnection(conn);
    // query statement
    Statement SQLStatement = Conn.createStatement();
    // generate query
    String Query = "SELECT * FROM md_portfolio";
    // get result
    ResultSet SQLResult = SQLStatement.executeQuery(Query);
       while(SQLResult.next())
          portfolio_id = SQLResult.getString("portfolio_id");
           p_rating = SQLResult.getInt("p_rating");  
    out.println("ID: " + portfolio_id + "<br>");
    out.println("Rating: " + p_rating + "<br>");
    //////////i want the stars to be out put here/////////////
         /*int value = p_rating;
         int i = 0;
            while (value[i] > 5)
                out.println(" * ");
                   values[i++];
    // close connection
    SQLResult.close();
    SQLStatement.close();
    Conn.close();
    %>My final plan is change the * for an actual image of a star. Please help i should know how to do this but i cant. Thanks.
    Message was edited by:
    JamesMorgan

    Thankyou it has kinda given me what i want.
    I have chanegd the code slightly to output like this for testing purposes:
    out.println("ID: " + portfolio_id + "<br>");
    out.println("Rating: " + p_rating + "<br>");//to be reomved once completed
    while (p_rating < 5) {
                p_rating++;
                 out.println("* ");
              out.println("<br>");
              out.println("--------------------<br>");which output this
    ID: 1
    Rating: 2
    ID: 2
    Rating: 2
    ID: 3
    Rating: 2
    ID: 4
    Rating: 3
    --------------------However if you see it ouputs the number of stars left not the actual rating its self.
    Any idea. i have changed the operators of the loop i.e. <= >= etc and has no luck. if i change it to -- not ++ then the pages just continuously fills with stars.
    any ideas please.

  • Help with loading dynamic classes ..need help please

    i'm trying to design a program where by i can load dynamic classes
    the problem i'm getting is that only one class is loading.
    classes are loaded by their names,and index numbers of public methods from a linklist
    .When the program runs only the first class is ever loaded and only the methods of that class ..
    help please
    //class loader
    import java.lang.reflect.*;
    import javax.swing.*;
    import javax.swing.event.*;
    import javax.swing.table.*;
    public class Test2 extends Thread
         public Class c;
         public Class Ray;
         public Class[] x;
         public static Object object = null;
         public Method[] theMethods;
         public static Method[] method,usemethod;
         public int methodcount;
         public static int MethodCt;     
         public static JList list;
    public Method[] startClass(String SetMethodName)
         try
              c = Class.forName(SetMethodName);
              object = c.newInstance();
              theMethods = c.getDeclaredMethods();
              // number of methods
              //methodcount = theMethods.length;
         catch (Exception e)
              e.printStackTrace();
    // return the array then invoke the particular method later
    return theMethods ;
    public void RunMethod(Method[] SomeMethod, int methodcount)
         try
              SomeMethod[methodcount].invoke( object,null );
         catch (Exception e)
              e.printStackTrace();
    // end class loader
    //main calling program
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing .*;
    import java.lang.reflect.*;
    public class JFMenu extends JFrame
         public static JMenu pluginMenu;
         public static JMenuBar bar;
         public static final Test2 w = new Test2();
    public static Method[] setmethod;
    private static ClassLinkList startRef = null;
    private static ClassLinkList linkRef3 = null;
    private static ClassLinkList startRef2 = null;
    private String ClassName,ShortCut;
    private int MethodNumber;
    private JMenuItem PluginItem;
         JFMenu()
              super (" JFluro ");     
              JMenu fileMenu = new JMenu("File");
              fileMenu.setMnemonic('F');
              JMenuItem exitItem = new JMenuItem("Exit");
              exitItem.setMnemonic('X');
              fileMenu.add(exitItem);
              exitItem.addActionListener
                   new ActionListener()
                        public void actionPerformed(ActionEvent event )
                             System.exit(0);
              JMenu pluginMenu = new JMenu("Plugins");
              pluginMenu.setMnemonic('P');
              startRef = new ClassLinkList ("Hello","Hello ",2,1926,"Painter");
              addToList("Foo","Foo ",0,1930,"Author");
              while (startRef.linkRef5 != null)
                   //pluginMenu.addSeparator();
                   ClassName = startRef.linkRef5.className;
                   ShortCut = startRef.linkRef5.shortcutName;
    MethodNumber = startRef.linkRef5.methodNumber;
    AddMenuItem(pluginMenu,ShortCut,ClassName,MethodNumber);
                   startRef.linkRef5 = startRef.linkRef5.next;
              // create menu bar and add JFMenu window to it
              JMenuBar bar = new JMenuBar();
              setJMenuBar(bar);
              bar.add(fileMenu);
              bar.add(pluginMenu);
              //attributes for JFMenu frame
              setSize(500,200);
              setVisible(true);
         }// end JFMenu constructor
         public void AddMenuItem(JMenu MainMenu, String shortcut,String className, final int methodCount )
              if (MainMenu==null)
                   return;
              //JMenuItem item;
              JMenuItem item = new JMenuItem(shortcut);
              MainMenu.add(item);
              setmethod = w.startClass(className);
              item.addActionListener
                   new ActionListener()
                        public void actionPerformed(ActionEvent event )
                             w.RunMethod(setmethod,methodCount);
              //item.addActionListener(ij);
         public JMenuItem AddMenuItem2(JMenu MainMenu, String shortcut)
              //if (MainMenu==null)
              //     return Main;
              //JMenuItem item;
              JMenuItem item = new JMenuItem(shortcut);
              MainMenu.add(item);
              //setmethod = w.startClass(className);
              //item.addActionListener(this);
                   new ActionListener()
                        public void actionPerformed(ActionEvent event )
                             w.RunMethod(setmethod,methodCount);
              //item.addActionListener(ij);
         return item;
         public void ReloadMenu(JMenuBar Bar, JMenu PluginMenu)
              if (Bar==null)
                   return;
              //     setJMenuBar(Bar);
              Bar.add(PluginMenu);
              //item.addActionListener(ij);
    public static void main (String args[])
              JFMenu menapp = new JFMenu();
    public static void addToList(String clname, String shcutname, int metnumber, int year2,
                                  String description) {
         // Create instance of class ClassLinkList
    ClassLinkList newRef = new ClassLinkList(clname,shcutname,metnumber,year2,
                                       description);
    // Add to linked list;
         startRef = startRef.addRecordToLinkedList(newRef);
    // end main calling program
    class Hello extends Thread
    public int getNum()
    System.out.println("I can be ");
    return 5;
    public void rayshowName()
    System.out.println("anything i want ");
    public void rayshowName3()
    System.out.println("to be ");
    class Foo extends Thread
    public int getNum()
    System.out.println("IMHOFF");
    return 5;
    public void rayshowName()
    System.out.println("raYMOND");
    // FAMOUS PERSONS LINKED LIST EXAMPLE
    // Frans Coenen
    // Saturday 15 January 2000
    // Depaertment of Computer Science, University of Liverpool
    class ClassLinkList {
    /* FIELDS */
    public String className;
    public String shortcutName;
    public int methodNumber;
    public int yearOfDeath;
    public String occupation;
    public ClassLinkList next = null;
    public ClassLinkList linkRef5 = this;
    public ClassLinkList startRef = null;
    /* CONSTRUCTORS */
    /* FamousPerson constructor */
    public ClassLinkList(String classname, String shortcutname, int methodnumber, int year2,
                                  String description) {
         className = classname;
         shortcutName = shortcutname;
         methodNumber = methodnumber;
         yearOfDeath = year2;
         occupation = description;
         next = null;
    /* METHODS */
    /* Output famous person linked list */
    public void outputClassLinkedList()
         //public ClassLinkList outputClassLinkedList() {
         ClassLinkList linkRef = this;
         // Loop through linked list till end outputting each record in turn
    while (linkRef != null)
         //System.out.println(linkRef5);
         System.out.println(linkRef.className + ", " + linkRef.shortcutName +
                   " (" + linkRef.methodNumber + "-" + linkRef.methodNumber +
                   "): " + linkRef.occupation);
         linkRef = linkRef.next;     
    //return linkRef;
    //public String ShowCasname()
    //return String ;     
    /* Add a new record to the linked list */
    public ClassLinkList addRecordToLinkedList(ClassLinkList newRef) {
         ClassLinkList tempRef, linkRef;
         // Test if new person is to be added to start of list if so return
    if (newRef.testRecord(this) ) {
         newRef.next = this;
         return(newRef);
         // Loop through remainder of linked list
         tempRef = this;
         linkRef = this.next;
         while (linkRef != null) {
         if (newRef.testRecord(linkRef)) {
         tempRef.next = newRef;
              newRef.next = linkRef;
              return(this);
         tempRef = linkRef;
         linkRef = linkRef.next;
    // Add to end
    tempRef.next = newRef;
         return(this);
    /* Delete a record from the linked list given the first and last name. Four
    posibilities:
    1) Record to be deleted is at front of list
    2) Record to be deleted is at end of list
    3) Record to be deleted is in middle of list
    4) Record not found. */
    public ClassLinkList deleteRecord(String lName, String fName) {
    ClassLinkList tempRef, linkRef;
    // Record at start of list
    if ((this.className == lName) & (this.shortcutName == fName))
         return(this.next);
         // Loop through linked list to discover if record is in middle of list.
         tempRef = this;
    linkRef = this.next;
    while (linkRef != null) {
         if ((linkRef.className == lName) & (linkRef.shortcutName == fName)) {
    tempRef.next = linkRef.next;
    return(this);
    tempRef = linkRef;
    linkRef = linkRef.next;
    // Record at end of list, or not found
    if ((linkRef.className == lName) & (linkRef.shortcutName == fName))
                        linkRef = null;
         else System.out.println("Record: " + lName + " " + fName + " not found!");
         return(this);
    /* TEST METHODS */
    /* Test whether new record comes before existing record or not. If so return
    true, false otherwise. */
    private boolean testRecord(ClassLinkList existingRef) {
         int testResult = className.compareTo(existingRef.className);
         if (testResult < 0) return(true);
         else {
         if ((testResult == 0) & (shortcutName.compareTo(existingRef.shortcutName) < 0 ))
                             return(true);
         // Return false
         return(false);
         public void addToList(String clname, String shcutname, int metnumber, int year2,
                                  String description)
         // Create instance of class Famous Person
    ClassLinkList newRef = new ClassLinkList(clname,shcutname,metnumber,year2,
                                       description);
    // Add to linked list;
         startRef = startRef.addRecordToLinkedList(newRef);

    I have a similar problem. I am writing a program to read the class names from database and instantiate several classes which extends from ServiceThread (an abstract class extending from Thread).
    rs = pStmt.executeQuery();
    while(rs.next()) {
    String threadclassname = rs.getString("classname").trim();
    try{
    ServiceThread threadinstance = (ServiceThread)Class.forName(threadclassname).newInstance();
    }catch ...
    So far, only the first class is ever instantiated and runs fine. But subsequent classes do not even get pass the "... ... Class.forName(...).newInstance();" line.
    Funny thing is that there are also no exceptions. The JVM just seem to hang there.

  • Database don't delete prom the table, help please !!

    there is my code :
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver").newInstance();
    Connection con=DriverManager.getConnection(jdbc:odbc:Medic);
    con.setReadOnly(false);
    try{
    Statement st=con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATABLE);
    int res=st.executeUpdate("DELETE FROM PATIENT WHERE PATIEN_ID="+id+";");
    System.out.println(String.valueOf(res)+" rows deleted");
    st.close();
    }catch(Exception exc){
    System.out.print(exc+"\n");
    the code execute with no error or exception , the message that i recieve is "1 rows deleted" and i want delete just one row, it's ok until the moment but whene i read the table i see that the row is not deleted.
    I use dBase database, help please !!!
    Thanks

    Don't trust the return value.
    Because you got no exception it means that the SQL executed. SQL can execute without deleting anything however if the where clause does not match.
    As posted your code is not valid java so anything else is meaningless.

  • HELP PLEASE!  list is killing me.

    Please someone help me. The actionPerformed is called based on the number of items in the list. eg. if the list has 3 items, actionPerformed will be called 3 times. However, I only double-click once.
    package threadreminder;
    import java.awt.*;
    import java.awt.event.*;
    class TaskThread extends Thread implements ActionListener{
         private int time;
         private int id;
         private List taskListArea;
         TaskThread(List taskListArea, String task, int time, String unit){
              super(task+time);
         id++;
              this.time=time*1000;
              if(unit.equals("minutes") ){
                   time=time*60;
              }else if (unit.equals("hours") ){
                   time=time*60*60;
              this.taskListArea=taskListArea;
              this.taskListArea.addActionListener(this);
              this.taskListArea.add(task);
              id=taskListArea.getItemCount()-1;
         public void run(){
              try{
                   Thread.sleep(time);
              }catch (InterruptedException e) {
              System.out.println("Thread wake: " + this.getName() + " " + time );
              taskListArea.select(id);
         public void actionPerformed(ActionEvent e){
              List sourceList=(List)e.getSource();
              String[] tasks=sourceList.getSelectedItems();
              for (int i=0; i<tasks.length; i++){
              System.out.println(tasks);

    I had the same problem with lists on our last application, I was trying to catch double clicks on an item in the list using an ActionListener, I changed to a MouseListener and used getClickCount() == 2 and that worked perfectly (actionPerformed was being called twice) maybe you could try this approach?

  • "HiLo" number guessing game not working - Help please!

    My game is compiling and read's right (in my head) but doesn't appear to work, any help is highly appreciated, thank you.
    Source code. More specifically, I think that it's properly getting the random number, but the guess prompt is not appearing, probably because of my while(random!=number) line?
    import javax.swing.JOptionPane;
    import java.util.Random;
    * High-Low (HiLo) game.
    * @author
    * @version 11/18/2010
    public class HiLo
        String randomNumber = "";
        int random;
        String userNum = "";
        int number;
         * Asks player if he wants to play, gets random number, gets user guess, checks the users guess, asks to repeat.
        public void play()
            getRandom();
            while(random!=number)
                getGuess();
                checkGuess();
         * Gets the users guess.
        public int getGuess()
            userNum = JOptionPane.showInputDialog ("Please Guess the number");
            int number = Integer.parseInt(userNum);
            return number;
         * Gets a random number between 0 and 100
         * int named random
        public int getRandom()
            Random randomNumber = new Random();
            int random = randomNumber.nextInt(101);
            return random;
         * Checks to see if the user's guess is an integer, between 0 and 100, and returns if
         * they're guess is too high or too low.
        public void checkGuess()
            if (number==random)
                JOptionPane.showMessageDialog(null, "You Win!");
            else if (number<random)
                JOptionPane.showMessageDialog(null, "Too low, guess again!");
            else if (number>random)
                JOptionPane.showMessageDialog(null, "Too high, guess again!");
    }Edited by: 811146 on Nov 18, 2010 3:11 PM

    Sorry about that Darryl,
    a few more questions on this code though.
    1.How can I have my getGuess() only accept integers?
    here it is now:
    public int getGuess()
            userNum = JOptionPane.showInputDialog ("Guess a number between 0 and 100");
            number = Integer.parseInt(userNum);
            return number;
        }and 2. How can I keep my whole play() in a loop? So that the game starts over
    my play() right now:
    public void play()
            getRandom();
            while(random!=number)
                getGuess();
                checkGuess();
            numberGuesses = 0;
            playAgain();
        }sorry, first year student!
    thanks for any help. All of the code if needed:
    import javax.swing.JOptionPane;
    import java.util.Random;
    * High-Low (HiLo) game. User guesses numbers while trying to guess a random number. Number of guesses is recorded and the user is told
    * at the end of the game after winning.
    * @author ----------
    * @version 11/18/2010
    public class HiLo
        String randomNumber = "";
        String userNum = "";
        int random;
        int number;
        int numberGuesses;
         * Asks player if he wants to play, gets random number, gets user guess, checks the users guess, asks to repeat.
        public void play()
            getRandom();
            while(random!=number)
                getGuess();
                checkGuess();
            numberGuesses = 0;
            playAgain();
         * Gets the users guess.
        public int getGuess()
            userNum = JOptionPane.showInputDialog ("Guess a number between 0 and 100");
            number = Integer.parseInt(userNum);
            return number;
         * Gets a random number between 0 and 100
         * int named random
        public int getRandom()
            Random randomNumber = new Random();
            random = randomNumber.nextInt(101);
            return random;
         * Checks to see if the user's guess is an integer, between 0 and 100, and returns if
         * they're guess is too high or too low.
        public void checkGuess()
            numberGuesses = numberGuesses+1;
            if (number==random)
                JOptionPane.showMessageDialog(null, "You Win!" + " " + "Number of guesses:" + " " + numberGuesses);         
            else if (number<random)          
                JOptionPane.showMessageDialog(null, "Too low, guess again!");
            else if (number>random)      
                JOptionPane.showMessageDialog(null, "Too high, guess again!");
         * Asks the user if they want to play again.
        public void playAgain()
            JOptionPane.showMessageDialog(null, "play again?");         
    }-javaStudent

  • ArrayIndexOutOfBoundsException help please.

    Ok so I know what an index out of bounds exception is and I have this hash function that is returning one to me for i dont know what reason!
    this is the code for the function : \
    public int hash(String word) {
    word = word.toLowerCase();
    int h = 0;
    for(int i = 0; i < word.length(); i++){
    int top = (i + 11) * (i + 11);
    int bot = (i + 1) * ( word.charAt(i) - 'a' + 1);
    h = top / bot;
    h %= size;
    It takes the word in from this function:
    public void getData(String filename){
         String word;
         SimpleIFStream Read = new SimpleIFStream(filename);
         while(!Read.eof()){
              word = Read.readString();
              put(word);
    This is the error I get
    Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: -1
         at HashTable.put(HashTable.java:62)
         at HashTable.getData(HashTable.java:53)
         at TestProgram1.main(TestProgram1.java:8)
    I'm thinking that I'm getting this error because my program is suppose to only take in letters a-z but it might be taking in periods and commas. The thing is I have this file StreamInFile to do my input/output already given to me and I don't know how to put in delimiters to make the program disregard periods and commas. But I'll ask you guys first what you think the problem is then maybe I can show you the StreamInFile code and you can tell me what to do with it because I'm a little lost!
    Thanks for all the help!
    PS: please please help!

    The code you posted wasn't even the right code.
    The stack trace shows you that you also need topost
    the methods in HashTable.java that include lines62
    (put() ) and the main() method fromTestProgram1.java.
    Well, there's no point in posting code from
    HashTable.java, as that's a standard class. The
    problem started with what he passed to it.Given that its HashTable and not
    java.util.Hashtable I'm not so sure.Let me rephrase that: The problem may still be with what's passed to it, but I think it's a hand-rolled HashTable.

  • Urgent help, please - 'Renaming' a JButton

    Hi guys,
    I'm trying to make a Scrabble game for a school project, but I'm stuck with a silly issue. The idea is that the board is made up out of 15x15 JButtons, and then this button is replaced with one sporting an image representing the letter the player chose to put there. Now I am getting a NullPointerException every time I try to change the JButton in any manner. I have tried different ways of accomplishing this, but I have not succeeded.
    Any help would be GREATLY appreciated, as I'm seriously running out of time.
    Thanks
    (Please bear in mind that the program is in very early stages, and I am very new to java)
    Here is my code:
    package scrabble;
    public class Main {
        public static void main(String[] args) {
            Board board = new Board(true);
    package scrabble;
    import java.awt.*;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import javax.swing.*;
    public class Player implements ActionListener {
        private JFrame frame;
        private Container con;
        private JButton[] btnHand = new JButton[7];
        private String[] alpha = new String[26];
        private int btnX, btnY;
        private Board board = new Board(false);
        public Player() {
            assignAplhabet();
        private void assignAplhabet() {
            int count = 0;
            for (int asc = 65; asc < 91; asc++) {
                alpha[count] = "" + (char) asc;
                count++;
        public void start() {
            frame = new JFrame("PLAYER 1");
            frame.setSize(400, 100);
            frame.setLocation(0, 0);
            con = frame.getContentPane();
            con.setLayout(null);
            con.setBackground(Color.LIGHT_GRAY);
            for (int k = 0; k < 7; k++) {
                int rndm = (int) (Math.random() * 26);
                // btnP1[k] = new JButton(alpha[rndm]);
                btnHand[k] = new JButton(new ImageIcon( alpha[rndm] + ".gif"));
                btnHand[k].setBounds(10 + k * 52, 10, 47, 47);
                con.add(btnHand[k]);
                // btnHand[k].addActionListener(this);
            frame.setVisible(true);
        public void boardBtnClicked(int x, int y, int w, int h) {
            btnX = x;
            btnY = y;
            frame.dispose();
            frame.setLocation((w / 2) - 200, (h / 2) - 100);
            frame.setTitle("Choose which letter to place.");
            frame.show();
            for (int r = 0; r < 7; r++) {
                btnHand[r].addActionListener(this);
        public void actionPerformed(ActionEvent e) {
            String text = (String) e.getActionCommand();
            board.placeLetter(btnX, btnY, text);
    }The error message is in here:
    package scrabble;
    import java.awt.event.*;
    import javax.swing.*;
    import java.awt.*;
    public class Board implements ActionListener {
        private JFrame boardFrame;
        private JLabel title;
        private Container con;
        private JButton[][] btnBlock = new JButton[15][15];
        private Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
        private Gameplay gameplay;
        private Color defaultColor;
        private Player p1;
        public Board(boolean first) {
            if (first) {
                createBoardFrame();
                createBoardBtns();
                //gameplay = new Gameplay();
                p1 = new Player();
                p1.start();
        private void createBoardFrame() {
            boardFrame = new JFrame("| SCRABBLE |");
            boardFrame.setSize(screenSize.width, screenSize.height);
            boardFrame.setLocation(0, 0);
            boardFrame.setVisible(true);
            boardFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            con = boardFrame.getContentPane();
            con.setLayout(null);
            con.setBackground(Color.CYAN);
        private void createBoardBtns() {
            int wide = screenSize.width;
            int high = screenSize.height;
            for (int y = 0; y < 15; y++) {
                for (int x = 0; x < 15; x++) {
                    btnBlock[x][y] = new JButton("");
                    btnBlock[x][y].setBounds(((wide - 780) / 2) + (x * 52), ((high - 780) / 2)
                            + (y * 52), 47, 47);
                    btnBlock[x][y].addActionListener(this);
                    con.add(btnBlock[x][y]);
            btnBlock[7][7].setBackground(Color.RED);
            title = new JLabel("SCRABBLE", JLabel.CENTER);
            title.setBounds((wide / 2) - 375, 0, 750, 50);
            title.setFont(new Font("Serif", Font.BOLD, 48));
            title.setForeground(Color.BLACK);
            con.add(title);
            boardFrame.setVisible(true);
            defaultColor = btnBlock[0][0].getBackground();
        public void placeLetter(int xx, int yy, String letter) {
            con.remove(btnBlock[xx][yy]);  // <<<<<---- THE ERROR MESSAGE POINTS HERE
            btnBlock[xx][yy] = new JButton(new ImageIcon(letter + ".gif"));
            btnBlock[xx][yy].setBounds(((screenSize.width - 780) / 2) + (xx * 52),
                    ((screenSize.height - 780) / 2) + (yy * 52), 47, 47);
            btnBlock[xx][yy].addActionListener(this);
            con.add(btnBlock[xx][yy]);
        public void actionPerformed(ActionEvent e) {
            for (int x = 0; x < 15; x++) {
                for (int y = 0; y < 15; y++) {
                    if (e.getSource() == btnBlock[x][y]) {
                        p1.boardBtnClicked(x, y, screenSize.width, screenSize.height);
    }

    Stykes wrote:
    Oh, sorry about that :/OK. Since you seem to have got my point, we'll continue.
    It won't allow me to edit the topic though? I'll try again now.A topic cannot be edited after it has been replied to. This is to prevent any reply that quotes text from the post to go 'out of line' with the the original post.
    Any help would still be very much appreciated.I tried compiling the code to find that:
    a) Classes like 'Board' were missing.
    b) It had no main(String[] args)
    c) It used images that I do not have here.
    All 3 of those problems can be fixed if you prepare an SSCCE. Normally I would advise to hot link to some images at my site for the images, but they are too big (640x480) for this task. So instead of that, you might use other small images you can find around the internet, like http://forums.sun.com/im/bronze-star.gif.
    - http://forums.sun.com/im/bronze-star.gif
    - http://forums.sun.com/im/silver-star.gif
    - http://forums.sun.com/im/gold-star.gif
    - http://forums.sun.com/im/platinum-star.gif
    The code would need to be altered something like this..
    String[] buttonAddreses = {
        "http://forums.sun.com/im/bronze-star.gif",
        "http://forums.sun.com/im/silver-star.gif",
        "http://forums.sun.com/im/gold-star.gif",
        "http://forums.sun.com/im/platinum-star.gif"
    try {
        for (int k = 0; k < 7; k++) {
            int rndm = (int) (Math.random() * 3);
            URL url = new URL(buttonAddreses);
    btnHand[k] = new JButton(new ImageIcon( url ));
    btnHand[k].setBounds(10 + k * 52, 10, 47, 47);
    con.add(btnHand[k]);
    } catch(MalformedURLException murle) {
    murle.printStackTrace();

  • Altering a text file using methods, help please!

    Hi I'm new to this forum so please bear with me, my problem is I have written a program for a gym using methods, my program works fine but i need to add another switch (case 5:) to my program, this new switch needs to take the information from case 4: and enable me to change any details and store these changes into a new text file, I know i need a filewriter to store new details into a new text file but i cant figure out how to get the details from case 4: into case 5: and be able to alter these details on screen??, hope this is enough information as to what my problem is. Thnx
    import javax.swing.JOptionPane;
    import java.io.*;
         class GymProgram1
    static void menu(String gym[][])
              int choice = 0;
    while (choice < 1 || choice > 5)
    String input = JOptionPane.showInputDialog("Enter a numerical choice to...\n1: Find customers who smoke, lost weight, use cycles, treadmills, steps, skis or weights \n2: Find customers over a certain age \n3: Find average of all customers \n4: Find a customers details \n5: Exit");
              if (input == null)
              menu(gym);
              try
              choice = Integer.parseInt(input);
              catch (NumberFormatException e)
              switch (choice)
              case 1: search(gym, choice);
                        break;
              case 2: age(gym, choice);
                        break;
              case 3: average(gym, choice);
                        break;
              case 4: details(gym, choice);
                        break;
              default: System.exit(0);
    menu(gym);
    static void search(String gym[][], int choice)
              String output = "";
              int column = 0;
              boolean printed = false;
    switch(choice)
    case 1: int yessearch = 0;
         while (yessearch < 1 || yessearch > 7)
    String input = JOptionPane.showInputDialog("Enter a numerical choice to...\n1: Find customers that smoke \n2: Find customers who lost weight \n3: Find customers who use cycles \n4: Find customers who use treadmill \n5: Find customers who use steps \n6: Find customers who use ski's \n7: Find customers who use weights ");
              if (input == null)
              JOptionPane.showMessageDialog(null, "Cancel pressed");
              menu(gym);
              try
              yessearch = Integer.parseInt(input);
              catch (NumberFormatException e)
         switch (yessearch)
              case 1:     column = 3;
                        break;
              case 2: column = 4;
                        break;
              case 3:     column = 5;
                        break;
              case 4:     column = 6;
                        break;
              case 5:     column = 7;
                        break;
              case 6:     column = 8;
                        break;
              default:column = 9;
         for (int row = 0;row < gym.length ;row++ )
              if (gym[row][column].equalsIgnoreCase("yes"))
              output += gym[row][0] + " " + gym[row][1] + '\n';
              printed = true;
              if (printed == false)
              output = "No data found......";
              display(output);
    static void age(String gym[][], int choice)
              String output = "";
              int column = 2;
              boolean printed = false;
              int ageentered=0;
              int customerage=0;
    String input=JOptionPane.showInputDialog("Enter an age");
              if (input==null)
              JOptionPane.showMessageDialog(null, "Cancel pressed");
              menu(gym);
              try
              ageentered =Integer.parseInt(input);
              catch (NumberFormatException e)
    switch(choice)
    case 2:
         for (int row = 0;row < gym.length ;row++ )
              customerage=Integer.parseInt(gym[row][column]);
              if (ageentered <= customerage)
              output += gym[row][0] + " " + gym[row][1] + " = " + gym[row][2] + '\n';
              printed = true;
              if (printed == false)
              output = "No data found......";
              display(output);
    menu(gym);
    static void display(String output)
         JOptionPane.showMessageDialog(null, output);
    static void average(String gym[][], int choice)
              boolean printed=false;
              String output="";
              int column = 0;
              int counter=0;
              int totalage=0;
              int average=0;
    switch (choice)
    case 3:
              column = 2;
         for (int row = 0;row < gym.length ;row++ )
              counter++;
              totalage+=Integer.parseInt(gym[row][2]);
              printed = true;
              average=totalage/counter;
              if (printed == false)
              output = "No data found......";
              output="Average age = " + average;
              display(output);
    menu(gym);
    static void details(String gym[][], int choice)
              String customer = "";
              String output = "";
              int column = 1;
              boolean printed = false;
    switch (choice)
    case 4: customer = JOptionPane.showInputDialog("Enter a customers surname");
              if (customer == null)
              JOptionPane.showMessageDialog(null, "Cancel pressed");
              menu(gym);
         for (int row = 0;row < gym.length ;row++ )
              if (gym[row][column].equalsIgnoreCase(customer))
              output += gym[row][0] + " " + gym[row][1] + "\n age = " + gym[row][2] + "\n smoke = " + gym[row][3] + "\n weight loss = " + gym[row][4] + "\n cycles = " + gym[row][5]+ "\n treadmills = " + gym[row][6] + "\n steps = " + gym[row][7] + "\n skis = " + gym[row][8] + "\n weights = " + gym[row][9] + '\n';
              printed = true;
              if (printed == false)
              output = "No data found......";
              display(output);
    static String[][] inputData()
              String gym[][] = new String[25][10];
         try
              FileReader file = new FileReader ("a:/assign.txt");
              BufferedReader buff = new BufferedReader(file);
         for (int row = 0;row<gym.length ;row++ )
              for (int column = 0; column < 10;column ++)
              gym[row][column] = buff.readLine();
              buff.close();
         catch (IOException e)
         System.out.println("Error - - " + e.toString());
         return gym;
    public static void main(String[] args)
              String gym[][] = inputData();
              menu(gym);
         for (int row = 0;row < gym.length ;row++ )
              System.out.println(gym[row][0] + " " + gym[row][1] + " " + gym[row][2] + " " + gym[row][3] + " " + gym[row][4] + " " + gym[row][5] + " " + gym[row][6] + " " + gym[row][7] + " " + gym[row][8] + " " + gym[row][9]);
         }

    Thnx for the reply TJ, I'm still confused about this problem, heres what ive done now and i still cant get the details of a customer up on the screen for me to change their details, i havnt pasted the whole program this time just what ive altered in the menu and case 5:, hope you can help.
    static void menu(String gym[][])
              int choice = 0;
    while (choice < 1 || choice > 6)
    String input = JOptionPane.showInputDialog("Enter a numerical choice to...\n1: Find customers who smoke, lost weight, use cycles, treadmills, steps, skis or weights \n2: Find customers over a certain age \n3: Find average of all customers \n4: Find a customers details \n5: Update a customers details \n6: Exit");
              if (input == null)
              menu(gym);
              try
              choice = Integer.parseInt(input);
              catch (NumberFormatException e)
              switch (choice)
              case 1: search(gym, choice);
                        break;
              case 2: age(gym, choice);
                        break;
              case 3: average(gym, choice);
                        break;
              case 4:
              case 5: details(gym, choice);
                        break;
              default: System.exit(0);
    menu(gym);
    static void details(String gym[][], int choice)
              String customer = "";
              String output = "";
              int column = 1;
              boolean printed = false;
    switch (choice)
    case 4: customer = JOptionPane.showInputDialog("Enter a customers surname");
              if (customer == null)
              JOptionPane.showMessageDialog(null, "Cancel pressed");
              menu(gym);
              for (int row = 0;row < gym.length ;row++ )
              if (gym[row][column].equalsIgnoreCase(customer))
              output += gym[row][0] + " " + gym[row][1] + "\n age = " + gym[row][2] + "\n smoke = " + gym[row][3] + "\n weight loss = " + gym[row][4] + "\n cycles = " + gym[row][5]+ "\n treadmills = " + gym[row][6] + "\n steps = " + gym[row][7] + "\n skis = " + gym[row][8] + "\n weights = " + gym[row][9] + '\n';
              printed = true;
              if (printed == false)
              output = "No data found......";
              display(output);
    case 5:
         try
              String display1 = "assign.txt";
              FileInputStream fi = new FileInputStream(display1);
              byte inData[] = new byte[fi.available()];
              fi.read(inData);
              fi.close();
              String text = new String(inData);
              String textToAppend = "kjkjhjhKJ";
              byte outData[] = textToAppend.getBytes();
              FileOutputStream fo = new FileOutputStream(display1,true);
              fo.write(outData);
              fo.close();
         catch(Exception e)
         System.out.println("Error - - " + e.toString());
    display(output);
    menu (gym);
    }

  • Trying to create a simple database program.....help, please

    I am trying to create a database and I am having trouble gettig my code correct..........I think I am on the right track but I haven't a clue from this point, can anyone point me in the right direction as far as getting my program to have a master file and a transaction file and be able to manipulate the data........records.
    import java.awt.*;
    import java.applet.*;
    public class recordsApplet
    // Declare variables
    String lstName;
    String frstName;
    Int socSec;
    String street;
    String city;
    String state;
    Int zip;
    float rate;
    Int numofdep;
    //The buttons =
    Button Submit = new Button("Add");
    Button Change = new Button("Change");
    Button Delete = new Button("Delete");
    submit.addActionListner(this);
    Change.addActionListener(this);
    Delete.addActionListener(this);
    //get input from users
    System.out.println("Last Name:")
    lstName = dataIn.readline();
    System.out.println("First Name:")
    frstName = dataIn.readline();
    System.out.println("Social Security #:")
    socSec = dataIn.readline();
    System.out.println("Last Name:")
    street = dataIn.readline();
    System.out.println("Last Name:")
    city = dataIn.readline();
    System.out.println("Last Name:")
    state = dataIn.readline();
    System.out.println("Last Name:")
    zip = dataIn.readline();
    System.out.println("Rate of Pay:")
    rate = dataIn.readline();
    System.out.println("Number of Dependants:")
    numofdep = dataIn.readline();
    public void main(String[] args)
    //store the information in a text file
    try
    output = DataOutputStream(new FileOutputStream("mocdb.txt"));
    catch(IOException er)
    system.exit(0)
    //Print fields to text file
    String arg = e.getActionCommand();
    String code;
    if (arg == "Submit")
    code = "A";
    elseif
    code = "C";
    else
    code = "D";
    try
    output.writeUTF(code);
    output.writeUTF(lstName.getText());
    output.writeUTF(frstName.getText());
    output.writeUTF(socSec.getText());
    output.writeUTF(street.getText());
    output.writeUTF(city.getText());
    output.writeUTF(state.getText());
    output.writeUTF(zip.getText());
    output.writeUTF(rate.getText());
    output.writeUTF(numofdep.getText());
    catch(IOException c)
    System.exit(1);
    //Retrieve record from file
    System.out.println("Last Name:")
    lstName = dataIn.readline();
    System.out.println("First Name:")
    frstName = dataIn.readline();
    try
    record = new DataInputStream(new FileInputStream("mocdb.txt");
    catch(IOException c)
    system.exit(2)
    //Check first and last name and get file
    //Change data in file
    //Delete the data in file

    Sorry, but your question has nothing to do with JavaHelp. Please use another forum.
    /Mauritz

  • I cannot open my Safari. I double click and still loading forever an ever. I cannot get to any preferences at the configurations bar. Any help please?What should a i do to fixe that?

    I cannot open my Safari. I double click and still loading forever an ever. I cannot get to any preferences at the configurations bar. Any help please?What should a i do to fixe that?

    I saw on another post you have asked about this dates LINC DAVIS:
    Date/Time:       2014-07-01 19:03:59 -0300
    OS Version:      10.7.5 (Build 11G63)
    Architecture:    x86_64
    Report Version:  9
    Command:         Safari
    Path:            /Applications/Safari.app/Contents/MacOS/Safari
    Version:         6.1.5 (7537.77.4)
    Build Version:   1
    Project Name:    WebBrowser
    Source Version:  7537077004000000
    Parent:          launchd [203]
    PID:             624
    Event:           hang
    Duration:        1.46s
    Steps:           15 (100ms sampling interval)
    Pageins:         7
    Pageouts:        0
    Process:         Safari [624]
    Path:            /Applications/Safari.app/Contents/MacOS/Safari
    Architecture:    x86_64
    UID:             501
      Thread 0x1597a      DispatchQueue 1
      User stack:
        15 ??? (in Safari) [0x10557ff2c]
          15 SafariMain + 266 (in Safari) [0x10577947c]
            15 NSApplicationMain + 867 (in AppKit) [0x7fff8b559eac]
              15 -[NSApplication run] + 470 (in AppKit) [0x7fff8b2dd9b9]
                15 -[BrowserApplication nextEventMatchingMask:untilDate:inMode:dequeue:] + 161 (in Safari) [0x1055e44d5]
                  15 -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] + 135 (in AppKit) [0x7fff8b2e107d]
                    15 _DPSNextEvent + 1247 (in AppKit) [0x7fff8b2e19c5]
                      15 AEProcessAppleEvent + 102 (in HIToolbox) [0x7fff82c85b69]
                        15 aeProcessAppleEvent + 250 (in AE) [0x7fff832b89f7]
                          15 _ZL25dispatchEventAndSendReplyPK6AEDescPS_ + 38 (in AE) [0x7fff832b8b03]
                            15 aeDispatchAppleEvent(AEDesc const*, AEDesc*, unsigned int, unsigned char*) + 200 (in AE) [0x7fff832b8c25]
                              15 _NSAppleEventManagerGenericHandler + 105 (in Foundation) [0x7fff896ed5dc]
                                15 -[NSAppleEventManager dispatchRawAppleEvent:withRawReply:handlerRefCon:] + 283 (in Foundation) [0x7fff896ed74e]
                                  15 __-[NSAppleEventManager setEventHandler:andSelector:forEventClass:andEventID:]_block_invoke_1 + 101 (in Foundation) [0x7fff896ee7c7]
                                    15 -[NSObject performSelector:withObject:withObject:] + 65 (in CoreFoundation) [0x7fff81947541]
                                      15 -[NSApplication(NSAppleEventHandling) _handleCoreEvent:withReplyEvent:] + 330 (in AppKit) [0x7fff8b2e45b9]
                                        15 -[NSApplication(NSAppleEventHandling) _handleAEOpenEvent:] + 227 (in AppKit) [0x7fff8b2e4849]
                                          15 -[NSApplication _reopenWindowsAsNecessaryIncludingRestorableState:registeringAsReady:completion Handler:] + 193 (in AppKit) [0x7fff8b2e49f9]
                                            15 _NSPersistentUIFinishAcquiringTalagentWindows + 93 (in AppKit) [0x7fff8b3108cb]
                                              15 copyTalagentWindowsAcquisitionBlock + 79 (in AppKit) [0x7fff8b310947]
                                                15 +[NSBundle mainBundle] + 55 (in Foundation) [0x7fff896e1bb9]
                                                  15 -[NSRecursiveLock lock] + 25 (in Foundation) [0x7fff896badf9]
                                                    15 __psynch_mutexwait + 10 (in libsystem_kernel.dylib) [0x7fff87733bf2]
      Kernel stack:
        15 psynch_mtxcontinue + 0 (in mach_kernel) [0xffffff800059eb20]
      Thread 0x1599d      DispatchQueue 2
      User stack:
        15 _dispatch_mgr_thread + 54 (in libdispatch.dylib) [0x7fff8ae7e316]
          15 kevent + 10 (in libsystem_kernel.dylib) [0x7fff877347e6]
      Kernel stack:
        15 kqueue_scan + 416 (in mach_kernel) [0xffffff800053b4d0]
      Thread 0x159a4   
      User stack:
        15 thread_start + 13 (in libsystem_c.dylib) [0x7fff8d3eeb75]
          15 _pthread_start + 335 (in libsystem_c.dylib) [0x7fff8d3eb8bf]
            15 _ZN3WTFL19wtfThreadEntryPointEPv + 15 (in JavaScriptCore) [0x105e2da3f]
              15 WebCore::IconDatabase::iconDatabaseSyncThread() + 303 (in WebCore) [0x106958faf]
                15 WebCore::IconDatabase::syncThreadMainLoop() + 491 (in WebCore) [0x10695c39b]
                  15 __psynch_cvwait + 10 (in libsystem_kernel.dylib) [0x7fff87733bca]
      Kernel stack:
        15 psynch_cvcontinue + 0 (in mach_kernel) [0xffffff800059e920]
      Thread 0x159a9   
      User stack:
        15 thread_start + 13 (in libsystem_c.dylib) [0x7fff8d3eeb75]
          15 _pthread_start + 335 (in libsystem_c.dylib) [0x7fff8d3eb8bf]
            15 thread_fun + 24 (in QuartzCore) [0x7fff81e65d35]
              15 CA::Render::Server::server_thread(void*) + 184 (in QuartzCore) [0x7fff81e65df5]
                15 mach_msg_trap + 10 (in libsystem_kernel.dylib) [0x7fff8773267a]
      Kernel stack:
        15 ipc_mqueue_receive_continue + 0 (in mach_kernel) [0xffffff8000215930]
      Thread 0x159b2   
      User stack:
        15 thread_start + 13 (in libsystem_c.dylib) [0x7fff8d3eeb75]
          15 _pthread_start + 335 (in libsystem_c.dylib) [0x7fff8d3eb8bf]
            15 __NSThread__main__ + 1575 (in Foundation) [0x7fff8970f6a2]
              15 -[NSThread main] + 68 (in Foundation) [0x7fff8970f72a]
                15 +[NSURLConnection(NSURLConnectionReallyInternal) _resourceLoadLoop:] + 335 (in Foundation) [0x7fff8971afd7]
                  15 CFRunLoopRunSpecific + 230 (in CoreFoundation) [0x7fff818e9486]
                    15 __CFRunLoopRun + 1204 (in CoreFoundation) [0x7fff818e9c74]
                      15 __CFRunLoopServiceMachPort + 188 (in CoreFoundation) [0x7fff818e150c]
                        15 mach_msg_trap + 10 (in libsystem_kernel.dylib) [0x7fff8773267a]
      Kernel stack:
        15 ipc_mqueue_receive_continue + 0 (in mach_kernel) [0xffffff8000215930]
      Thread 0x159b7   
      User stack:
        15 thread_start + 13 (in libsystem_c.dylib) [0x7fff8d3eeb75]
          15 ??? (in Safari) [0xdeadbeef]
            15 dlopen + 540 (in dyld) [0x7fff65188657]
              15 dyld::runInitializers(ImageLoader*) + 97 (in dyld) [0x7fff651821b9]
                15 ImageLoader::runInitializers(ImageLoader::LinkContext const&, ImageLoader::InitializerTimingList&) + 59 (in dyld) [0x7fff6518d0b7]
                  15 ImageLoader::recursiveInitialization(ImageLoader::LinkContext const&, unsigned int, ImageLoader::InitializerTimingList&) + 237 (in dyld) [0x7fff6518c2cd]
                    15 _ZN4dyldL12notifySingleE17dyld_image_statesPK11ImageLoader + 226 (in dyld) [0x7fff65180973]
                      15 load_images + 233 (in libobjc.A.dylib) [0x7fff8897636b]
                        15 call_load_methods + 161 (in libobjc.A.dylib) [0x7fff889766ca]
                          15 +[VSearchLib load] + 92 (in libVSearchLoader.dylib) [0x109b72bf4]
                            15 -[NSBundle principalClass] + 41 (in Foundation) [0x7fff8970ed84]
                              15 -[NSBundle load] + 18 (in Foundation) [0x7fff897173f8]
                                15 objc_msgSend_vtable3 + 24 (in libobjc.A.dylib) [0x7fff889780d8]
      Kernel stack:
        15 hndl_alltraps + 225 (in mach_kernel) [0xffffff80002da481]
          15 user_trap + 711 (in mach_kernel) [0xffffff80002c4017]
            15 exception_triage + 149 (in mach_kernel) [0xffffff8000220e15]
              15 exception_deliver + 766 (in mach_kernel) [0xffffff8000220c1e]
                15 exception_raise_state_identity + 325 (in mach_kernel) [0xffffff8000249c75]
                  15 mach_msg_rpc_from_kernel_body + 277 (in mach_kernel) [0xffffff80002239d5]
                    15 ipc_mqueue_receive + 70 (in mach_kernel) [0xffffff8000215886]
                      15 thread_block_reason + 299 (in mach_kernel) [0xffffff800022f42b]
                        15 thread_continue + 1661 (in mach_kernel) [0xffffff800022f1ad]
                          15 machine_switch_context + 361 (in mach_kernel) [0xffffff80002c2939]
      Binary Images:
             0x10557f000 -        0x10557ffff  com.apple.Safari 6.1.5 (7537.77.4) <1144E535-39EB-3DD2-8326-F931E2CEDFC5> /Applications/Safari.app/Contents/MacOS/Safari
             0x105589000 -        0x105ac2fff  com.apple.Safari.framework 7537 (7537.77.4) <079F7B57-311E-3A81-B3ED-B7AC3F78E262> /System/Library/StagedFrameworks/Safari/Safari.framework/Safari
             0x105e24000 -        0x1061cbff7  com.apple.JavaScriptCore 7537 (7537.77.1) <C0C6D15C-8C26-3FD8-BE2E-7A1C20B46359> /System/Library/StagedFrameworks/Safari/JavaScriptCore.framework/JavaScriptCore
             0x106953000 -        0x107a00ff7  com.apple.WebCore 7537 (7537.77.4) <E0176EFF-835E-3B32-909D-E3A426947476> /System/Library/StagedFrameworks/Safari/WebCore.framework/WebCore
             0x109b72000 -        0x109b73fff  libVSearchLoader.dylib ??? (???) <2DF78468-AB4B-363E-A838-D4CE14679E8B> /System/Library/Frameworks/VSearch.framework/Versions/A/Libraries/libVSearchLoa der.dylib
          0x7fff6517f000 -     0x7fff651b3baf  dyld ??? (???) <C58DAD8A-4B00-3676-8637-93D6FDE73147> /usr/lib/dyld
          0x7fff818b1000 -     0x7fff81a85ff7  com.apple.CoreFoundation 6.7.2 (635.21) <62A3402E-A4E7-391F-AD20-1EF20236CE1B> /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation
          0x7fff81e63000 -     0x7fff82003ff7  com.apple.QuartzCore 1.7 (270.5) <19E5E0AB-DAA9-3F97-988C-D9A46AFB9C04> /System/Library/Frameworks/QuartzCore.framework/Versions/A/QuartzCore
          0x7fff82c75000 -     0x7fff82fa1fff  com.apple.HIToolbox 1.9 (???) <CCB32DEA-D0CA-35D1-8019-E599C8007AB6> /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/HIToolbox.fra mework/Versions/A/HIToolbox
          0x7fff832b5000 -     0x7fff832f4fff  com.apple.AE 527.7 (527.7) <B82F7ABC-AC8B-3507-B029-969DD5CA813D> /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/AE.fram ework/Versions/A/AE
          0x7fff8771d000 -     0x7fff8773dfff  libsystem_kernel.dylib ??? (???) <66C9F9BD-C7B3-30D4-B1A0-03C8A6392351> /usr/lib/system/libsystem_kernel.dylib
          0x7fff8896d000 -     0x7fff88a51e5f  libobjc.A.dylib ??? (???) <871E688B-CF57-3BC7-80D6-F6476DFF109B> /usr/lib/libobjc.A.dylib
          0x7fff896b5000 -     0x7fff899cefff  com.apple.Foundation 6.7.2 (833.25) <22AAC369-B63C-3C55-8AC6-C3ECBA44DA7B> /System/Library/Frameworks/Foundation.framework/Versions/C/Foundation
          0x7fff8ae7c000 -     0x7fff8ae8afff  libdispatch.dylib ??? (???) <8E03C652-922A-3399-93DE-9EA0CBFA0039> /usr/lib/system/libdispatch.dylib
          0x7fff8b2d9000 -     0x7fff8bedffff  com.apple.AppKit 6.7.5 (1138.51) <44417D02-6123-3FC3-A119-CE51BB4C3006> /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit
          0x7fff8d39d000 -     0x7fff8d47afef  libsystem_c.dylib ??? (???) <41B43515-2806-3FBC-ACF1-A16F35B7E290> /usr/lib/system/libsystem_c.dylib

  • Cannot publish from iWeb to .Mac, Help please!

    I am trying to publish to my site from here in Australia. I was able to publish in the country at the beggining of the trip, but can not now. I get the message "Publish Error - an error occurred while publishing file /Web/Site/iWeb/Site/Blog". I had updated two blog entries and changed the date on an entry. Since then in trying to fix the issue I deleted both of those entries. I have been through .mac support troubleshooting steps to ensure it is not a network error. I have been able to publish to a folder, but when I try to copy the Blog folder from that folder to my iDisk I get "The Finder cannont complete the operation because some data in "" could not be read or written (Error code -36)". Since then they asked that I try to publish from a trial .Mac account or from a new OS X user account on my machine. Both of those attempts failed as well, which they say indicates it's not a .mac account or OS X user set up issue. They asked that I put a copy of my domain file out in the public drive for them to look at, but when I try to do that it goes through and does the copying and then freezes at "Copying Domain.zip to Public, Copied 599.5MB of 599.5MB (Closing file...) - Please wait". Then I get the same error code -36 and am disconnected from iweb. Can anyone out there help please?
    Thanks!

    Thanks and Merry Christmas to you too! I have experienced both modem/network problems and was unable to publish in Tahiti and Cook Islands because of that and now these problems which have nothing to do with network it seems - so yours may or may not be network related. I was able to cheat and copied my "Site" folder from my hard drive to my iDisk rather then publishing. I can't remember if you've tried this or not (read a lot of strings today) but you can publish to a folder and then copy that folder to your iDisk at /Web/Sites/iWeb/Site as "Site" after first renaming the one that is out there now. Let me know if you have any questions on how to do it. It sounds like you are traveling like we are and anxious to communicate with friends and family back home. When you are bored, our site is web.mac.com/baganworldtour.
    At least we now have our first update out there in two weeks. But it took almost two hours to copy the folder and this won't work forever. Hopefully we, whether by the discussion room or .mac support next week, will be able to fix the problem for real.
    Thanks. Good Luck. Merry Christmas

Maybe you are looking for

  • Strange Problem with a Vector wraped inside a Hashtable

    Hi all , I'm having a strange problem with a Vector wraped within a Hashtable inherited Class. My goal is to keep the order of the elements of the Hashtable so what I did was to extend Hashtable and wrap a Vector Inside of it. Here is what it looks l

  • Java Class Library

    What's the online Java Class Library reference site? I swore it was on this Java.sun.com site, but I can't seem to locate it again. Thanks, MB

  • Password key missing from Registry

    Hi, I have a 3rd party application running in Windows2008 Server-Std SP2 where on each time this apps launched, It will read/update the registry file which contains below info. This setting is required for a remote DB connection. On each connection t

  • Is there a PDF print driver for ipad

    I want to be able to print individual pages from an excel file so i can email them. So i am looking for a print driver or print program to make this happen Some of the apps i have a re polaris office, expert PDF, Adobe.

  • Root Bridge vs. Non-Root Bridge

    Hi, I want to understand the Root Bridge vs. the Non-Root Bidge when using Autonomous 1131 AP's on the same /24 network. Does that command matter in Autonomous? I have many devices working without issues on the same /24 network and all have the Root