Repeating methods?

Hi there, i have an issue which i cant solve. when ever i call a method from another class in my program, it repeatst he method twice. any thoughts?
Here is my code:
import java.util.*;
public class Driver {
     public static void main(String args[])
          Bank bank = new Bank();
          while (true)
               try
               System.out.println("");
               System.out.println("-----COMMAND LIST------");
               System.out.println("");
               System.out.println("");
               System.out.println("1 - Open a new account");
               System.out.println("2 - Close an account");
               System.out.println("3 - Credit an account");
               System.out.println("4 - Debit an account");
               System.out.println("5 - Balance request");
               System.out.println("6 - Account info");
               System.out.println("7 - EXIT");
               System.out.println("");
               Scanner input = new Scanner(System.in);
               int command;
               System.out.println("");
               System.out.print("Please enter a command: ");
               command = Integer.parseInt(input.nextLine());
               if (command == 1) {
               System.out.print("Please enter the clients name ");
               String name = input.nextLine();
               Account account = new Account (name);
               bank.openAccount(account);
               System.out.println("account opened for: " + bank.openAccount(account));
               if (command == 2) {
                              System.out.print("Please enter the clients name ");
                              String name = input.nextLine();
               if (command == 3) {
                              System.out.print("Please enter the number of the account ");
                              int acNumber = Integer.parseInt(input.nextLine());
                              bank.creditAccount(acNumber);
               if (command == 4) {
                                             System.out.print("Please enter the clients name ");
                                             String name = input.nextLine();
               if (command == 5) {
                                             System.out.print("Please enter the clients name ");
                                             String name = input.nextLine();
               if (command == 6) {
                                             System.out.print("Please enter the number of the account ");
                                             int acNumber = Integer.parseInt(input.nextLine());
                                             bank.acDetails(acNumber);
               if (command == 99) {
                    System.exit(0);
               }catch(Exception ex)
               {//handle exception
                    System.out.println("");
                    System.out.println("");
                    System.out.println("");
                    System.out.println("---NOT A VALID INPUT---"); //print message to console
                    System.out.println("---A NUMBER MUST BE ENTERED---");
                    System.out.println(ex);
                    System.out.println("");
AND THE OTHER CLASS IS:
import java.util.*;
public class Bank
     ArrayList<Account> accountList = new ArrayList();
     //constructor
     public void Bank()
     public Account openAccount (Account a)
          a.setAcNumber();
          accountList.add(a);
          System.out.println( accountList);
          //System.out.println("Account number: " + a.getAcNumber());
          return a;
     public void closeAccount (String s)
     public void creditAccount (int i)
          int position = 0;
                    while (position <= accountList.size()-1)
                         Account tempAccount = accountList.get(position);
                         int temp = tempAccount.getAcNumber();
               if (temp == i){
                    Scanner input = new Scanner(System.in);
                    System.out.print("How much would you like to credit the account? ");
                    int credit = Integer.parseInt(input.nextLine());
                    int currentBalance = tempAccount.getBalance();
                    int newBalance = currentBalance + credit;
                    tempAccount.setBalance(newBalance);
                    position++;
     public void debit (int i)
     public int checkBalance ()
     return 1;
     public void acDetails (int i)
          int position = 0;
          while (position <= accountList.size()-1)
               Account tempAccount = accountList.get(position);
               int temp = tempAccount.getAcNumber();
               if (temp == i)
                    System.out.println("");
                    System.out.println(" Account number: " + tempAccount.getAcNumber());
                    System.out.println(" Held by: " + tempAccount.getAcName());
                    System.out.println(" Balance: " + tempAccount.getBalance());
                    System.out.println("");
               position++;
}

Please use code tags.
import java.util.*;
public class Driver {
     public static void main(String args[])
          Bank bank = new Bank();
          while (true)
               try
               System.out.println("");
               System.out.println("-----COMMAND LIST------");
               System.out.println("");
               System.out.println("");
               System.out.println("1 - Open a new account");
               System.out.println("2 - Close an account");
               System.out.println("3 - Credit an account");
               System.out.println("4 - Debit an account");
               System.out.println("5 - Balance request");
               System.out.println("6 - Account info");
               System.out.println("7 - EXIT");
               System.out.println("");
               Scanner input = new Scanner(System.in);
               int command;
               System.out.println("");
               System.out.print("Please enter a command: ");
               command = Integer.parseInt(input.nextLine());
               if (command == 1) {
               System.out.print("Please enter the clients name ");
               String name = input.nextLine();
               Account account = new Account (name);
               bank.openAccount(account);
               System.out.println("account opened for:  " +  bank.openAccount(account));
               if (command == 2) {
                              System.out.print("Please enter the clients name ");
                              String name = input.nextLine();
               if (command == 3) {
                              System.out.print("Please enter the number of the account ");
                              int acNumber = Integer.parseInt(input.nextLine());
                              bank.creditAccount(acNumber);
               if (command == 4) {
                                             System.out.print("Please enter the clients name ");
                                             String name = input.nextLine();
               if (command == 5) {
                                             System.out.print("Please enter the clients name ");
                                             String name = input.nextLine();
               if (command == 6) {
                                             System.out.print("Please enter the number of the account ");
                                             int acNumber = Integer.parseInt(input.nextLine());
                                             bank.acDetails(acNumber);
               if (command == 99) {
                    System.exit(0);
               }catch(Exception ex)
               {//handle exception
                    System.out.println("");
                    System.out.println("");
                    System.out.println("");
                    System.out.println("---NOT A VALID INPUT---"); //print message to console
                    System.out.println("---A NUMBER MUST BE ENTERED---");
                    System.out.println(ex);
                    System.out.println("");
*AND THE OTHER CLASS IS:*
import java.util.*;
public class Bank
     ArrayList<Account> accountList = new ArrayList();
     //constructor
     public void Bank()
     public Account openAccount (Account a)
          a.setAcNumber();
          accountList.add(a);
          System.out.println( accountList);
          //System.out.println("Account number: " + a.getAcNumber());
          return a;
     public void closeAccount (String s)
     public void creditAccount (int i)
          int position = 0;
                    while (position <= accountList.size()-1)
                         Account tempAccount = accountList.get(position);
                         int temp = tempAccount.getAcNumber();
               if (temp == i){
                    Scanner input = new Scanner(System.in);
                    System.out.print("How much would you like to credit the account? ");
                    int credit = Integer.parseInt(input.nextLine());
                    int currentBalance = tempAccount.getBalance();
                    int newBalance = currentBalance + credit;
                    tempAccount.setBalance(newBalance);
                    position++;
     public void debit (int i)
     public int checkBalance ()
     return 1;
     public void acDetails (int i)
          int position = 0;
          while (position <= accountList.size()-1)
               Account tempAccount = accountList.get(position);
               int temp = tempAccount.getAcNumber();
               if (temp == i)
                    System.out.println("");
                    System.out.println(" Account number:  " + tempAccount.getAcNumber());
                    System.out.println(" Held by:         " + tempAccount.getAcName());
                    System.out.println(" Balance:         " + tempAccount.getBalance());
                    System.out.println("");
               position++;
  }You have missed the Account class, and the code has not been shrunk to include just what is needed to show the problem and is too long for me to bother reading. Either include the Account class so I can run it and/or remove everything that is not needed to show the problem you are experiencing.

Similar Messages

  • How to restrict repeated method call?

    I have a method which fetches data from DB and returns a map.
    public Map myDataList(){
    returns mymap;
    I call this method in the body of another method.
    public void myCall(){
    myDatalist();
    now i want myDatalist() method to be called only once even if myCall() is executed multiple times.

    Kapil wrote:
    but if i call the method in a static block will it give what i want?
    static{ 
    }I'm not quite sure why you're so fixated on only calling a method once. What's wrong with:
    static {
       // some set-up code
       while (moreRowsToFetch) {
          fetchAnotherRow();
    }But Kayaman's quite right. Explain what you want properly.
    Winston

  • Bootcamp windows 8.0 pro installation issue with early 2015 Macbook Pro

    I am having this issue with installing Windows 8.0 pro (and 8.1 pro) on my early 2015 MacBook pro vs. Bootcamp. I have tried different method for  multiple times and all failed. Any help is appreciated.
    Hardware: (1) early 2015 MacBook Pro with 128GB (13 inches) , (2) Sony USB DVD burner. (3) Two 16 gb flash drive 2.0 version from two different manufactures
    Software: (1) 8.0 Pro ISO on flash drive from Microsoft (I have two copies) (2) 8.1 Pro downloaded from Microsoft website.
    Note -  I was able to download the bootcamp supporting files successfully and copy to a USB flash drive.
    Method 1 - Create the installation disk from ISO on flash drive and also tried copying ISO on hard drive (desktop)- failed.
    I have a 16 GB flash drive (2.0V) connected
    ISO is a valid 8.0 pro copy from Microsoft came on a flash drive.
    I have the windows 8.0 pro ISO on a flash drive and plugged in.
    Issue -  It gets to around 50% of "Copying Windows files..." and then doesn't go any further.  8 hours later, still stuck at around 50%.  I also tried to do the copy ISO from desktop. failed as well.
    Method 2 - I repeat the above steps with Windows 8.1 ISO downloaded Microsoft website - failed. Stuck at 50% copying windows file for 9 hours.
    Method 3 - I burned the Windows 8.0 pro ISO to a DVD and try to do the installation through a DVD instead.  DVD was successfully created.
    I was able to perform the partition.  When the computer reboots, it starts the window installation. However, it got stuck at 7% forever. I tried this multiple times and failed.
    Method 4 - I download a 8.1 Pro ISO from Microsoft website, I burned it to a DVD. Repeat method 3,  Again, windows installation stuck at 7%.
    Method 5 - I called Apple. - What they told me is pretty much repeat the above steps. Still failed.

    The ISO file(s) being downloaded seem to be corrupted. Can you use Microsoft FCIV tool - https://support.microsoft.com/en-us/kb/841290?wa=wsignin1.0 ?
    The DVDs should be burnt at the recommended rate for the physical media. DU should be used for burning the DVDs.
    Reference Disk Utility 12.x: Burn a disk image to a CD or DVD and Boot Camp: Creating an ISO image from a Windows installation DVD - Apple Support.

  • Distiller missing text and image links when saving to pdf

    Not sure if anyone has experienced this issue before. Basically I create artwork 1up in indesign CS3 and print as a postscript file "print ready settings" then create a pdf through distiller 8.1.2. After this I then imposition the 1up PDF back into indesign (using the pdf as a link and then step and repeat it) then I print the new imposed artwork as postscript file again and distill it as a PDF ready for offset printing.
    Most time this process works like a dream, but every now and then distiller doesn't want to process the file correctly and images and sometimes text have dropped off the final imposed PDF file. It doesnt notify me of any problems when distilling. As you can imagine working in the print industry this is VERY SCARY
    As i am using a common 1up pdf link the imposition should be correct, (all the pdf linked images should be the same anyway) Is it a memory issue, or a bug in distiller perhaps.
    Im running a Mac with OSX 10.4.11 with 2Gig of RAM.
    If you would like to see a sample of the issue let me know.
    Any help on this would be awesome.

    thanks for the replies,
    Working in a pre-press environment we obviously prefer to print from pdf files (as opposed to using supplied native art). As a result I am always receiving pdf files from external clients who have saved their artwork from indesign to pdf format, so Im not sure what the real difference is between me imposing a supplied indesign/pdf files in indesign vs me imposing my own indesign/pdf files in indesign. (aprt from perhaps going through distiller twice)
    i can see what your saying though and for years i have been using the cut and paste and step and repeat method but recently changed my workflow for a few reasons
    - I noticed that by printing a 1up pdf and relinking the file back into my indesign imposition the final imposed pdf was lower in size
    - if a client made a change to the artwork after imposing (which always happens) all i had to do was make the change, resave the pdf 1up link again and update the link and it did it for me and saved me from step and repeating all over again,
    - whenever the job was printed again in the future i could use the same procedure, resave as 1up pdf again and update the link.
    - plus i knew that if i was using the one link all my step and repeats would be exactly the same each time (and i didn't have to worry that a graphic that hadn't been selected/grouped correctly and would drop off when step and repeating)
    .....and for sure it probably is a slightly longer way to impose a job for print but it saves me half the time on the next print run, and i can use my imposition file as a template for similar jobs also.
    I have found the workflow i use works fine, apart from these rare hiccups which i can get around by resaving the pdf again anyway, but what Im really worried about is the times this error presents itself and doesn't notify me that a problem has occurred.

  • Convert row to columns in BLS

    Hi All,
    There is data in grid format
    example
    a b c d
    e f g h
    i j k l
    This has to be sent to RFC in the same format as table
    I took one row as comma separated in BLS converted string list to XML but it appears under one column
    item
    |_a
    |_b
    |_c
    |_d
    a,b,c,d appears as row but I need to map it as columns in Illuminator document
    That is a,b,c,d which appears as row needs to be converted to columns so that they can be mapped to illuminator document
    Thanks in advance
    Regards
    Namita

    If your source is SQL 2005, you can do this in the query using the UNPIVOT command, but if you have to do it in BLS, its not TOO terrible, you just need to nest a repeater.
    You'll need 3 repeaters, the first one is a row repeater, you will use this to define your columns.  Basically take the output of the repeater, then use the xmlcolumn action to define the names of your output column.  If you want the first column from your original source document to be the names of the columns in your output, then use bind the "name" property of the xmlcolumn action to the First column of the source document.  It will look something like this
    Repeater_0.Output{/Row/Col1}
      Where "Col1" is the Column you want to get your names.
    Now that you have defined your column names, you can end that repeater.   The next repeater will be a row repeater with source XML being /Rowsets/Rowset/Row, nested in that you put another repeater using the columns /Rowsets/Rowset/Columns/Column.   Now here's the tricky part, the first time you run through the column repeater, you need to create rows, but after that, the rows are created so you just need to assign a value to the XML, fortunatly, thats easy enough to do with a conditional (CurrentItem == 1)   So the first time through the repeater, you do an XML Row, since you created your column headers dynamically, you will have to assign the "value" property something like
    xmldocOutput.Output{/Rowsets/Rowset/Row[#repRow.CurrentItem#]/#repCol.Output{/Column/@Name}#}
    After the first time through the repeater, you just use the xml Data Item, you can do the assignment in the same way 
    xmldocOutput.Output{/Rowsets/Rowset/Row[#repRow.CurrentItem#]/#repCol.Output{/Column/@Name}#}
    This is how I've done it in BLS.  You can also repeat through row, build a local string, use StringList To XML Parser block to do something like this.   But personally I like the nested repeater method. 
    Sorry this isn't easier, its a lot easier to see with the actual transaction, but this is how I do it.  Maybe somebody else has a better method.

  • What is the "Live" page and need help in data merge

    Hello,
    Im very new to indesign so bare with me. Im trying to data merge (Need to create a merge template?) and from what I understand is that I need it to be on the "Live" page. Someone on the forum suggested this.....
    There are two ways to set up the merge template. You can put your placholders on the master page or on the live page. If the placehlders are on the master page, only the frame(s) with the placeholders, along with any other grouped objects, will be duplicated. On the live page, ID will try to duplictate EVERYTHING on the page, so you must be very careful about the setup and sizing of objects.
    I would like to be on the LIVE page...how do I do this? I got everything else sorted but cannot get multiple records for the life of me to come up.
    Thanks in adavance for your help

    Thanks for all your help, Peter. I will do the step and repeat method like you said. I dont know why I cant get this camera for the images to work but I did what you said with Word paint after capturing the page using the keyboard. Unfortunately I cant copy and paste the indesign screen to this page.
    Thanks again for your patience and good help.
    With kind Regards,
    John
    P.S Im sure you will see more questions as I make my way through indesign. LOL

  • Whatsapp crash in ios 8

    Hi to all ,
    kindly help me to fix my whatsapp , it going crash .

    The one thing that has allowed me to regain some of this functionality is to go in the settings section within the app (not the Settings app) and literally just tap through the different screens within the section. No really repeatable method I can tell anyone. It has allowed me to be able to send mail from GoodReader and PDF Expert again.
    As near as I can tell, this problem seems to be a security-related one involving an app trying to play in the Mail app's sandbox. Tapping through the settings appears to sometimes give the original app permission (again) to send mail.
    I've had some success with this method on both the iPad and iPhone.

  • Can someone review my code please

    I wrote a program for converting miles to kilometers and kilometers to miles. I've got it working good now, but there's something I can't figure out. The way I have it now, after you convert something, if you choose not to make another conversion, it exits the program. I'd like to make it go back to the main menu rather than exiting. In other words; if I convert miles to kilometers and then decide I want to do a kilometers to miles conversion, I'd like a way to return to the main menu without exiting the program. I would really appreciate any suggestions. Also, please feel free to give me pointers on better ways to make my code in general. Go easy though, I know I'm a newb. I didn't get any help making this, so please be kind. I apologize if it's hard to read; I wrote it in Jgrasp and it formated it weird when I opened it with wordpad.
    Thanks
    Here's the code:
    import java.util.*;
    public class Squires1
    Scanner keyboard = new Scanner(System.in);
         //Allows for keyboard inputs
         public void milesToKilometers()//Method for converting miles to kilometers
              double kilometers;
              String more;//Used in option for additional conversions
              final double OFFSET = 0.62136994949495;//number for conversion
              do
                   System.out.print( "Please tell me the number of miles: ");
              //Prompts user for miles
                   double miles = keyboard.nextDouble();
                   kilometers = (miles / OFFSET);
                   //calculates number of kilometers
                   System.out.println(miles + " miles is equal to " + kilometers + " kilometers.");
                   System.out.println("Would you like to make another conversion?");
                   System.out.println("Yes or No");
                   more = keyboard.next();
                        if
                        (more.equalsIgnoreCase("Yes"))
                             System.out.println("One Moment Please");
                        else
                             System.out.println("Thanks for using my program.");
                             System.out.println("Please tell your friends.");
                             System.exit(0);//Exits program if additional conversions are not desired
                   }while (more.equalsIgnoreCase("Yes"));//Repeats method if yes is typed
         public void kilometersToMiles()//Method for converting kilometers to miles
              double miles;
              String more;//Used in option for additional conversions
              final double OFFSET = 0.62136994949495;//number for conversion
              do
                   System.out.print( "Please tell me the number of kilometers: ");
              double kilometers = keyboard.nextDouble();
                   miles = (kilometers * OFFSET);//Converts kilometers to miles
                   System.out.println(kilometers + " kilometers is equal to " + miles + " miles.");
                   System.out.println("Would you like to make another conversion?");
                   System.out.println("Yes or No");
                   more = keyboard.next();
                   if
                   (more.equalsIgnoreCase("Yes"))
                        System.out.println("One Moment Please");
                   else
                        System.out.println("Thanks for using my program.");
                        System.out.println("Please tell your friends.");
                        System.exit(0);//exits program if user types "no"
                   }while (more.equalsIgnoreCase("Yes"));//Repeats loop if user types "yes"
              public static void main(String[] args)//main method
                   Squires1 s1 = new Squires1();//creates new instance of class      
                   int option;
                   Scanner keyboard = new Scanner(System.in);//allows for keyboard inputs
         System.out.println( "I can convert distances for you. Please tell me what you'd like to do.");
         System.out.println( "1. Convert miles to kilometers ");
                   System.out.println( "2. Convert kilometers to miles ");
                   System.out.println( "3. End our session. ");
         option = keyboard.nextInt();
              if (option == 1)
                   s1.milesToKilometers();//runs milesToKilometers method
                        if (option == 2)
                        s1.kilometersToMiles();//runs kilometersToMiles method                }
                        if (option == 3)
                             System.out.println("Thanks for using my program.");
                             System.out.println("Have a nice day.");
                   }while (option != 3);//Repeats main method as long as user doesn't type 3
    }

    Here's another instance of my code with tags.
    import java.util.*;
    public class Squires1
    Scanner keyboard = new Scanner(System.in);
    //Allows for keyboard inputs
    public void milesToKilometers()//Method for converting miles to kilometers
    double kilometers;
    String more;//Used in option for additional conversions
    final double OFFSET = 0.62136994949495;//number for conversion
    do
    System.out.print( "Please tell me the number of miles: ");
    //Prompts user for miles
    double miles = keyboard.nextDouble();
    kilometers = (miles / OFFSET);
    //calculates number of kilometers
    System.out.println(miles + " miles is equal to " + kilometers + " kilometers.");
    System.out.println("Would you like to make another conversion?");
    System.out.println("Yes or No");
    more = keyboard.next();
    if
    (more.equalsIgnoreCase("Yes"))
    System.out.println("One Moment Please");
    else
    System.out.println("Thanks for using my program.");
    System.out.println("Please tell your friends.");
    System.exit(0);//Exits program if additional conversions are not desired
    }while (more.equalsIgnoreCase("Yes"));//Repeats method if yes is typed
    public void kilometersToMiles()//Method for converting kilometers to miles
    double miles;
    String more;//Used in option for additional conversions
    final double OFFSET = 0.62136994949495;//number for conversion
    do
    System.out.print( "Please tell me the number of kilometers: ");
    double kilometers = keyboard.nextDouble();
    miles = (kilometers * OFFSET);//Converts kilometers to miles
    System.out.println(kilometers + " kilometers is equal to " + miles + " miles.");
    System.out.println("Would you like to make another conversion?");
    System.out.println("Yes or No");
    more = keyboard.next();
    if
    (more.equalsIgnoreCase("Yes"))
    System.out.println("One Moment Please");
    else
    System.out.println("Thanks for using my program.");
    System.out.println("Please tell your friends.");
    System.exit(0);//exits program if user types "no"
    }while (more.equalsIgnoreCase("Yes"));//Repeats loop if user types "yes"
    public static void main(String[] args)//main method
    Squires1 s1 = new Squires1();//creates new instance of class
    int option;
    Scanner keyboard = new Scanner(System.in);//allows for keyboard inputs
    System.out.println( "I can convert distances for you. Please tell me what you'd like to do.");
    System.out.println( "1. Convert miles to kilometers ");
    System.out.println( "2. Convert kilometers to miles ");
    System.out.println( "3. End our session. ");
    option = keyboard.nextInt();
    if (option == 1)
    s1.milesToKilometers();//runs milesToKilometers method
    if (option == 2)
    s1.kilometersToMiles();//runs kilometersToMiles method }
    if (option == 3)
    System.out.println("Thanks for using my program.");
    System.out.println("Have a nice day.");
    }while (option != 3);//Repeats main method as long as user doesn't type 3
    }

  • Using WebView & WebEnginer

    Hello there,
    I am a total newbie to JavaFX and also in some ways to Java. I am trying to create a user interface in HTML and then able to dynamically change the content of HTML from the Java code.
    As a first step, i have a HTML file in my hard disk that has HTML, JavaScript & CSS in it. I can use the WebEngine.Load() to load this page. The HTML page consists of buttons, text area (paragraph) and some images.
    The goal is, when the user clicks on the HTML buttons i should be able to get the event in Java code, and then send new images and texts to the HTML user interface.
    I see that it's possible to call JavaScript functions in the HTML page. But is it possible to get HTML button clicks inside the Java Code?
    Thanks in advance.

    Please see my code below. It's not formatted, but if you copy that into a editor, it should work fine.
    public class MyClass extends Application {
        WebView webView = null;
        @Override
         public void start(Stage primaryStage) { 
            final BorderPane root = new BorderPane(); 
            webView = new WebView();        
            File f = new File("main.html");
            System.err.println("webView 1st time - "+webView);
            try {
                webView.getEngine().load(f.toURI().toURL().toString());
            catch (MalformedURLException e)
            root.setCenter(webView); 
            webView.getEngine().documentProperty().addListener(new ChangeListener<Document>() { 
                @Override 
                public void changed(ObservableValue<? extends Document> obs, Document oldDocument, Document newDocument) { 
                    if (newDocument != null) { 
                        EventTarget startButton = (EventTarget) newDocument.getElementById("ButtonOk"); 
                        startButton.addEventListener("click",new EventListener() { 
                            @Override 
                            public void handleEvent(Event evt) { 
                                System.out.println("Start Button pressed!"); 
                                getInstance().StartTimer();
                        }, true);                     
            final Scene scene = new Scene(root, 390, 590); 
            primaryStage.setScene(scene); 
            primaryStage.show(); 
        public static void main(String[] args) {
            launch(args);
        public void myTimer ()
      String strP8 = "I am here Now!";
              webView.getEngine().executeScript("changeText('"+strP8+"')"); // Fails here as webView is NULL          
        public class TimerSample extends ProofOfConcept{
            Timer timer = null;
                public void StartTimer() {
                    //1- Taking an instance of Timer class.
                    timer = new Timer("BIO");
                    //2- Taking an instance of class contains your repeated method.
                    MyTask t = new MyTask();
                    timer.schedule(t, 0, 1000);    
                public void StopTimer()
                timer.cancel();
                timer.purge();
            class MyTask extends TimerTask {
                //times member represent calling times.
                private int times = 0;
                public void stop()
                this.cancel();           
                public void run() {
                        myTimer ();
            TimerSample sampleX = null;
            public TimerSample getInstance ()
            if (sampleX == null)
            sampleX = new TimerSample();
            return sampleX;

  • Apple airport or belkin n600 MaxHD?

    What's better to get/use? The apple airport or belkin n600 MaxHD?
    I.e I have an old wireless N router from belkin and I find that it's not giving me my range or strength anymore.
    So I'm looking to upgrade. At the current moment I have an iMac iPhone 4 and an iPad 2 in the house. Soon maybe to have a wireless printer.
    Which router works out best on paper and for real?
    Your thoughts please.
    Thank you.

    Is the belkin in universal wireless extender mode??
    If so it is unreliable and the best solution is to replace it with an apple router. Apple uses a different repeater method and it is more reliable.. however no repeater method is 100% reliable.. if you need reliable use ethernet not wireless to extend.

  • Editing problems due to DIVs in formatted email messages?

    Mail.app 5.3 (1283) on MacOS 10.7.5
    I have problems editing some incoming emails due, I theorize, to DIV sections inserted by some email clients.  When  I reply to these messages,  it is difficult or impossible to open vertical space to insert interspersed reply text.
    Question 1:   Anyone else experience this problem?
    Sometimes --but not reliably-- the DIV sections are represented in message editing by mail.app with rectangular boxes.  But I've delayed posting because I couldn't reliably produce examples.
    Finally,  I blundered into a repeatable method of producing these boxes, when pasting some material from a reference web site into a message I was composing in mail.app. The details are unimportant.  Here are examples of the rectangles, on the top unselected, and on the bottom in the selected condition:
    Question 2:   Anyone else see these?
    Question 3:   What is mail.app telling us by displaying these rectangles?   Why does this whatever-it-is deserve its own close box?
    IOW: Is there any documentation to be found of this unusual, perhaps unique notation?
    I sent this message to myself and viewed its contents using View --> Message --> Raw Source.  In the formatted (HTML) portion, I found some DIV sections more or less corresponding to the rectangles seen in the graphic.   
    Question 4:  Besides viewing Raw Source in an incoming message, is there any other support in mail.app (or an add-on) to make such formatting visible?
    I have problems responding to some incoming formatted messages containing more or less routine text from non-technical people. I haven't been systematic about collecting data, but:  examining the HTML source of the most problematic message to date reveals the only formatting other than simple text styling:   all the body text in in one DIV section or another.    In this particular case, I had no choice but to top-post.  
    In most cases when I have trouble editing response messages, these boxes show up -- but only in the selected condition; they are invisible when unselected.  In this most-problematic case, strangely, I have been unable to persuade mail.app to display the rectangles. So, perhaps visibility of the boxes signal the presence of DIVs plus additional tags.
    I'm guessing that some email clients insert DIVs and other non-font-styling tags in formatted messages ... for whatever reason.   I've heard that email standards are ... loose. 
    Question 4:  Does mail.app (or an add-on) support  removing or somehow taming (removing?)  these DIVs?
    I can't think of a remotely feasible way of solving this problem myself. The View --> Message --> Raw Source window is not editable.  Certainly the content could copied and pasted into a text editor, for modification --which might be semi- or completely automated, with luck-- but I can't see any practical way of inserting the results back into the email.  Sniff the raw messages in mail.app's own storage?  I don't think so. 
    Question 5: Other approaches?
    TIA

    Without knowing what it said exactly on your order confirmation documents, in general what the BT staff told you was actually correct as that has always been part of the terms for the free BT Sport pack. It has been a topic of heated discussion several times on the BT TV forums since the BT Sport offer was announced last May. You are starting a new 12 month minimum term for your existing deal and any existing broadband discounts will still end on the original planned date, so you will have to pay full price for the remainder of the new minimum term (unless you negotiate a new deal and start yet another new 12 month minimum term).
    This is what it said in the BT Sport bit of my order from May 2013
    Your BT broadband contract
    If you've recontracted your broadband to get BT Sport at the discounted rate, any special offers for broadband that you currently receive will continue on the same terms you originally agreed to. If you have a special offer that runs for a set period of time, that will end on the date you originally agreed. The basic price of your BT broadband will remain unchanged and this is what you'll pay once any special offer ends.
    I'm not saying I agree or disagree with it, just pointing out that it was always part of the terms that people signed up to. You've done well if you managed to get it overturned.

  • Cannot delete text message

    I have looked through the forum until my eyes hurt to find a solution, so I apologize if this has been covered before. Here's the problem:
    I had sent a text message a few days ago and it failed. So, I resent it and it still failed, so I deleted it. Gone, right? Wrong. Now, I get a notification on the top bar that says "text message not sent" and when you tap on it to see the text message, an error message box pops up and says "message not available". So then I press the clear button and the notification goes away. Gone right? Wrong. The failed message stays gone until you open the text messaging menu and bang, the error message comes back. How do I get rid of this? It's not particularly irritating, but it does leave an icon on the notification bar constantly, why?

    There have been a number of people experience this issue. There seems to be some sort of basic problem, but I don't know if anyone has found a repeatable method to produce this problem.
    As far as I know the only way to get rid of the message is to restore factory defaults on your device. There are a number of threads here that describe the processing for completing this.
    Jason

  • My iMac don't start up properly

    I Don't know what exactly happen to my iMac. But, it will start up then display spinning wheel with loading bar below which first time I seen. I try to resolved this issue by myself by use disk utilies. When I was done with disk utilies, I restart it. Then it do same thing but this time, went black and shut down. I unable to get further than this point.
    I suspect that it occur when I accident use webcomic as wallpaper. Reason is that I can't change wallpaper until I restart. Which start loading bar issue.
    I did scan for any possible spyware or virus, it come clean.
    Message was edited by: Marc Richards

    back with more bad news, It failed to load up, stuck in spinning whell for long time. I repeat method for 3 time now. it still not load.
    My guess that my iMac has hardware failure.
    Message was edited by: Marc Richards

  • MSI K9A2 Platinum - What bios can run 1066Mhz 2x2GB ram?

    Hi
    I am trying to help out a friend who has this board, we've tried 4 different mushkin xp2-8500 2x2GB kits
    We've tried everything but cannot get over 950Mhz stable.
    Currently using BIOS ver:1.5
    Any ideas.
    Thanks
    Greg

    Still no luck.  950Mhz was set with a fsb increase.
    Here is what we've tried.
    #1
    Using 1 stick of ram set
    DRAM Timing Mode: Auto
    Adjust CPU Frequency: 200
    FSB/Memory Ratio: 2.66
    Memory Voltage Control: 2.0-2.1v
    Chipset Voltage Contro: 1.31v
    HT bus Voltage: 1.31
    memory to ganged memory mode
    Next add other dimm
    If that doesn't post with
    Try un-ganged mode.
    #2
    Using the POH Bios
    DRAM Timing Mode: Auto
    DRAM Timing Mode: Auto
    Adjust CPU Frequency: 200
    FSB/Memory Ratio: 2.66
    #3
    Using only 1 stick of ram
    DRAM Timing Mode: manual
    CAS Latency (CL): 5
    TRCD: 5
    TRP: 5
    tRTP: 2-4 or 3-5
    TRAS: 15
    TRC: 31 (26 if max)
    tWR: 6
    TRRD: 5
    tRWTTO: Auto
    tWRRD: Auto
    tWTR: 6(or max if less)
    tWRWR: Auto
    tRDRD: Auto
    tRFC0: 375ns (4 if not using 375ns method of naming)
    tRFC1: 375ns
    tRFC2: 375ns
    tRFC3: 375ns
    Bank Interleaving: Disabled (Try enabled later)
    Adjust CPU Frequency: 200
    FSB/Memory Ratio: 2.66
    Memory Voltage Control: 2.0-2.1v
    Chipset Voltage Contro: 1.31v
    HT bus Voltage: 1.31
    memory to ganged memory mode
    Next add other dimm
    #4
    Using the POH Bios
    Repeat Method #3
    #5
    DRAM Timing Mode: Auto
    Adjust CPU Frequency: 266
    FSB/Memory Ratio: 2.0
    Memory Voltage Control: 2.0-2.1v
    Chipset Voltage Contro: 1.31v
    HT bus Voltage: 1.31
    memory to ganged memory mode
    Next add other dimm
    #6
    DRAM Timing Mode: Manual
    CAS Latency (CL): 5
    TRCD: 5
    TRP: 5
    tRTP: 2-4 or 3-5
    TRAS: 15
    TRC: 31 (26 if max)
    tWR: 6
    TRRD: 5
    tRWTTO: Auto
    tWRRD: Auto
    tWTR: 6(or max if less)
    tWRWR: Auto
    tRDRD: Auto
    tRFC0: 375ns (4 if not using 375ns method of naming)
    tRFC1: 375ns
    tRFC2: 375ns
    tRFC3: 375ns
    Bank Interleaving: Disabled (Try enabled later)
    Adjust CPU Frequency: 266
    FSB/Memory Ratio: 2.0
    Memory Voltage Control: 2.0-2.1v
    Chipset Voltage Contro: 1.31v
    HT bus Voltage: 1.31
    memory to ganged memory mode
    Next add other dimm
    All result in max 950Mhz, from multiple kits.
    Any ideas on a bios that will work?

  • Method repeat problem

    Hi guys.
    have some prob with the following, appreciate the help.
    the Main Method is,
    asking the user to input a specific number, if the specific number does not match it repeats the same message input.
    i use the if statement to do this(not to sure whether it is correct,
    i want to use the while loop, but does not know how to put it)
    anyway it did the job BUT when i try to return the value from my method(the method is "square root the input number").
    it will square root the specific input number but does not pops up the input message when the input number is not the specific number.
    i think the problem lies in the if statement on where i put it or i need to use the while loop.
    below is the program.
    statements in bold is the pop up screen
    MAIN METHOD
    Ask user to input the number;
    input=Double.parseDouble(inputStr);
    IF \\ the number match
    double numbered = number(input);
    show values of square root of input  is numbered
    ELSE IF \\ the number is not match
    Ask user to input the number; \\ask the user to input in the specific number again
    METHOD
    public static Double number(double x)
    double squareroot = Math.sqrt(x);
    return squareroot;

    Hi,
    I may be opening up a can of worms here but in the few years I have been learning Java I have never used a do-while loop. Perhaps that is a short-coming of my own but your use of it looks real messy.
    I've taken the code I wrote earlier and have included the message dialogs to show you how to use the YES_OPTION. It works well and is less complicated than your attempt. There is probably a neater solution but hopefully you can take something from this.
    import javax.swing.*;
    public class Checker{
         private int theAnswer;
         public Checker(){
              theAnswer = 1 + (int)(Math.random() * 100); //generate a random number between 1 and 100
                 getInput();
         //Get input as per your earlier code
         private void getInput(){
                 //get the input from the user here;
                 String inputStr;
                int input; 
                inputStr = JOptionPane.showInputDialog (null, "Enter a number between 1 and 100");
                input = Integer.parseInt(inputStr);
                validateInput(input); //now check the input
         private void validateInput(int d){
              //invalid input. Tell the user they have made an error and call getInput() again
                 if(d < 1 || d > 100){
                      JOptionPane.showMessageDialog(null, "Number is not between 1 and 100!", "Input Error!", JOptionPane.ERROR_MESSAGE);
                      getInput();
                 //entry is ok
                 else{
                      //check if the input is the answer
                      if(d == theAnswer)
                      //correct answer given
                      JOptionPane.showMessageDialog(null, "Correct!", "Good guess!", JOptionPane.INFORMATION_MESSAGE);
                      //wrong answer given
                      else{
                           //let user choose whether they want to guess again
                           if(JOptionPane.showConfirmDialog(null,
                             "Wrong answer. Would you like another go?",
                             "Guessing Game",
                             JOptionPane.YES_NO_OPTION,
                             JOptionPane.QUESTION_MESSAGE,
                             null) == JOptionPane.YES_OPTION)
                           getInput(); //call to getInput() again as user has selected yes
                      //if the program has got here either the user has correctly guessed
                      //or the user chose not to guess again.
                      System.exit(0);
         public static void main(String [] args){
              Checker c = new Checker();
    }Regards,
    Chris
    Message was edited by:
    lordflasheart

Maybe you are looking for