How should I do this...

I am creating a program that requires a few random numbers to be generated every second. How can I accomplish this? I have heard that activeobjects are capable of performing tasks at regular intervals, but I have yet to find a tutorial that explains how to use them.

read the API: java.util.Timer and java.util.Random

Similar Messages

  • I want to use one apple id in my macbook and iPad but i don't want pics to get sync and show in both devices, how should i stop this ?

    I want to use one apple id in my macbook and iPad but i don't want pics to get sync and show in both devices, how should i stop this ?

    Turn off My PhotoStream in iCloud on both the iPad and the Mac. PhotoStream is what shares your photos (unless you are using iCloud Photo Library Beta, in which case, all photos uploaded are accessible from all devices signed onto the same Apple/iCloud ID).
    Cheers,
    GB

  • I accidentally dropped macbook air that was in a book bag. The keyboard is working because I can see the light but the screen is black and it won't turn off. How should I fix this? Please Help ME!!

    I accidentally dropped my friend's macbook air that was in a book bag. The keyboard is working because I can see the light but the screen is black and it won't turn off. How should I fix this? Please Help ME!!
    I tried to turn it off and it didn't work... and I held on to the shift key too and it still doesn't work..
    Please help me..

    Accidental damage is not covered under Apple warranty.  And it seems there is much accidental damage.  Only a Genius Bar tech looking at it can tell how much it will cost to repair.
    Cost to repair will be high, I suspect (though Genius Bar will confirm/deny.
    There is no gentle way to say this sir/ma'am ... someone will need to pay for your friend's MBA repairs.

  • Old Macbook to New Macbook Air Transfer but new Macbook Air has less Storage Space. I only want to keep all iTunes and iPhoto Files. I can keep the rest on an External HD. How should I do this?

    Bought a New Macbook Air and wanting to transfer only iTunes and iPhoto stuff to the new Macbook Air. How should I do this? Ive got and External HD acting as Time Machine but the Data on there is 143G worth and the New Macbook Air is a 128G HD. So i dont need all the extra Documents but want to keep them on the External HD which has been Partitioned.
    Question is - How do I transfer the iTunes and iPhoto info into the New Macbook air and keep all its settings ect and also keep the Docs ect in the HD? Time Machine wont work as there is too much info for the New Macbook Air.
    What should I do?

    In iTunes 11 uncheck the preferences setting in in the iTunes Preferences panel "Advanced > Copy Files to iTunes Media folder when adding to Library"

  • I have a problem in iphone4,i am from india and bought a new unlocked iphone4 from USA last month.the problem is when i call someone their is disturbance in the voice and i cant hear the opposite person voice.please inform me how should i overcome this?

    I have a problem in iphone4,i am from india and bought a new unlocked iphone4 from USA last month.the problem is when i call someone their is disturbance in the voice and i cant hear the opposite person voice.please inform me how should i overcome this?

    There may be a defect in the phone. As you bought it in the US the only place you can get it looked at is in the US.
    When you say you bought it new, unlocked did you buy it directly from an Apple store? If you did not it was hacked to unlock it, which could also be your problem. Apple stores are the only place in the US that sells legitimately unlocked iPhones.

  • HT1725 Some songs that I paid for fully downloaded, but it is only playing the small sample piece from the Itunes store. How should I fix this?

    I had a Wish List with about 7 or 8 songs on there and I purchased them today. They all downloaded fine, except for 2. These two songs completed the download from what the computer says, but it will only play the short sample avaliable from the Itunes store. How should I fix this?

    Other people have been having similar problems with songs over the last few days, I assume that there has been a problem with Apple's servers.
    Depending upon what country that you are in (music can't be re-downloaded in all countries) then try deleting them from your iTunes library and redownload them via the Purchased link under Quick Links on the right-hand side of the iTunes store home page on your computer's iTunes : re-downloading.
    If you aren't in a country where you can re-download music or if they re-download in the state then try the 'report a problem' link from your purchase history : log into your account on your computer's iTunes via Store > View My Account and you should then see a Purchase History section with a 'see all' link to the right of it ; click on that and you should see a list of your purchases ; find those songs and use the 'Report a Problem' link.

  • My phone started vibrating mutiple times last night and the screen went black, and then it stopped and now I dont know what to do.  How should I fix this problem because I cant turn it back on?

    My phone started vibrating mutiple times last night and the screen went black, and then it stopped and now I dont have a clue what to do.  How should I fix this problem because I cant turn it back on? I have only had my phone for 2 months.

    I also live an hr away from the Apple store, so its not the best thing to go there just to ask a question and find out what to do

  • So, my phone won't connect to my mac computer when I plug the USB charger into my computer and then into my phone it won't charge or connect. How should I fix this?

    So, my phone won't connect to my mac computer when I plug the USB charger into my computer and then into my phone it won't charge or connect. How should I fix this?

    Test with another computer and another cable
    To discover if the problem is eith the phone the cable or computer

  • [SOLVED] How should I understand this ATI wiki?

    Hello,
    I'm trying to reduce my power consumption and found this article: https://wiki.archlinux.org/index.php/Ati#Powersaving
    But I'm not sure how to understand this:
    I enabled KMS.
    First it says the power saving feature is disabled by default. Then it tells me I should use "sysfs" to change that. I don't have any application with that name, wikipedia tells me that its an virtual file system and there is no mention of "sysfs" anywhere in the wiki except this article. To confuse me even more, it tells me in the next passage that I should either use the sysfs interface that should be present by default because I use a recent version, or use the (unsupported) [radeon] repo.
    Now I'm confused.
    Also it doesn't mention how to check if it works correctly, so if anyone did this before, please tell me how I should understand this.
    Thanks for your help
    Last edited by GNA (2011-04-05 13:55:04)

    GNA wrote:ah, so I can skip this whole block if my kernel is newer than 2.6.35. That could be stated clearer thx 4 help
    Well its a wiki. Feel free to correct it.

  • Should I use an external hard drive to store the files while editing and how should I do this?

    Getting used to FCPX and want help learning how to store my Canon D60 Video files on either my internal Mac book pro or on an external hard drive while editing projects?   Do the files need to be transcoded on the computer drive or can that happen on an external HD?
    Thanks,
    Greg

    Well, in my opinion, it all comes down to speed. There are a lot of editors that swear that working with footage on your system drive will do all sorts of horrible things, cause crashes, etc. Really its a bunch a malarkey. The most it will do is slow you down when your system needs access to the drive. Bandwidth is bandwidth is bandwidth - its all the same. If working with video on your system drive caused crashes, so would doing thousands of other things and we would all have dumped apple long ago for Microsoft or linux.
    Here's what I tend to get for sustained read speed on various drives (ie reading a few large files like video files):
    USB 2.0: 25 - 30 MB/sec. Drive RPM doesn't matter much since USB is limiting factor, unless you're running a system.
    Firewire 400: 28 - 34 MB/sec.  Drive RPM doesn't matter much since FW is limiting factor
    Firewire 800: 55 - 60 MB/sec.  Drive RPM doesn't matter much since FW is limiting factor
    internal drive on SATA II or III connection, or USB 3.0 external drive:
        7200 RPM: ~100 MB/sec
        5400 RPM (most laptop drives): probably ~70-80 MB/sec
    SSD: 250-500 MB/sec if installed internally or over USB 3. USB 2 or firewire connection for an SSD is a waste of SSD speed *except* that they have fantasticly fast random access for reading many small files, so I got a really fast launching system in an experiment installing a system on an SSD and connecting it via FW 800 - but that's not relevant here
    so - to make a short story long - do whatever works for you. avoid using USB 2.0 or firewire 400 drives if you're editing HD - you can't play transcoded ProRes 1080p footage from them reliably. And once you have more than one clip overlapping, like at cross dissolves, you're sunk. You're internal drive is likely much faster, even with the overhead of the system using it too.
    Blackmagic Disk Speed Test on the app store is a good HD speed tester. Ignore all the video specific stuff at the bottom - its mostly for uncompressed video, which I doubt you're working with.
    Since i have a recent macbook pro (late 2011) and my edits are usually not more dense than 3 layers of video at a time (mostly concert video rather than narrative film), I actually almost never transcode, or even render - and this is for 1080p HD video - because FCP X is so good at playing the imported original h.264 files. I store my media I'm working with on my internal laptop drive (which i upgraded to a 7200 RPM) or a FW 800 7200 RPM external drive.
    h.264 files from the camera are much smaller than transcoded ProRes files, so they will play back from USB 2 or firewire 400 drives, but I would only do it in a pinch.
    enjoy your editing.

  • Hows should I do this?

    Ok trying a bit of programming, first in ages...
    Trying to make 2 classes, Player and GameTest. Ok, what i want to do is for a prompt to ask the user for firstname, secondname, nickname etc...you will see in the code.
    This is player:
    import java.io.* ;
    class Player
        String line, firstName, secondName, nickName;
        int    age;
        char   sex;
        // constructor
        Player( String first, String last, String nick, int age, char sex )
           firstName = first ;
           secondName = last ;
           nickName = nick ;
        BufferedReader userIn =
            new BufferedReader(
            new InputStreamReader( System.in ) );
        System.out.println("Please enter your first name:" );
        firstName = userIn.readLine();
        System.out.println("Please enter your second name:" );
        secondName = userIn.readLine();
        System.out.println("Please enter your nickName:" );
        nickName = userIn.readLine();
        System.out.println("Please enter your age:" );
        line = userIn.readLine();
        age = Integer.parseInt( line );
        System.out.println("Are you male or female?:" );
        sex = userIn.readLine();
        //put in if m=male or f=female otherwise error
        void details()
              System.out.println( "Your details: " + firstName + secondName);//and all the rest....
    }This is gameTest:
    class GameTest
      public static void main( String[] args )
        Player player1 = new Player(
            Andrew, Schofield, Sco, 22, M);
        System.out.println( "Your details: "
            + player1.details() );
    }Now instead of me typing in my details into the code, i would like to be prompted on it, so do I need all the lines of code prompting in the player class, or the game test?
    My overall idea is to have like a text based story game, you know with loads of decisions which effect the way the book turns out. I want those decisions to effect characteristics which the user enters at the start, so age will increase, nickname may change etc etc, all depending on decisions in the story. I may also need to add more than 1 player, so thats why i have the player class...
    Could anyone modify my code so that it will do what I want, either that or give me some simple advice to follow, as I am kind of new to java.
    Any help?
    Sco

    Ok I seem to be stuck now. have managed to creater a player object by having the details entered into the code. I dont know how to make it so that the user can input the details himself...well I kind of do. In one of the posts I showed above, I used the readline method, but I am not sure how to get thisinfo to go into the constructor in my test class. Sorry if this doesn't make sense... Here is what i have:
    import java.io.*;
    class Player
      // instance variables
      String firstName;   // First Name
      String surName;     // Second name
      String nickName;   // nick Name
      int age;
      String line;
      // constructor
      Player(  String first, String sur, String nick, int age  )
        firstName = first;
        surName   = sur;
        nickName  = nick;
        this.age       = age;
      BufferedReader userIn =
            new BufferedReader(
            new InputStreamReader( System.in ) );
      // methods
      String details()
        String result = "\nFirst Name: "+firstName+"\nSur Name: "+surName+"\nNickname: "+nickName;
        return result;
      String names()
            System.out.println("Please enter your first name:" );
            firstName = userIn.readLine();
         System.out.println("Please enter your second name:" );
         surName = userIn.readLine();
         System.out.println("Please enter your nickName:" );
         nickName = userIn.readLine();
      int age()
            System.out.println("Please enter your age:" );
            line = userIn.readLine();
         age = Integer.parseInt( line );
    }Now I can make each of the attributes (ie the 3 names) into seperate methods if its going to be easier?
    Now I want the info it stores to replace this line of code in PlayerTest.java
    Player player = new Player( "Andy", "Schofield", "Sco", 22 ); That is what I am not too sure of. If you could help that would be great.
    EDIT: Actually can i just replace "Andy" with firstName, "Sco" with nickName or will that not work? Also my age keeps on coming out as 0, do I need to do something there too?
    Cheers
    Andy

  • Renamed 'appleuser' to my name. Mistake. How should I fix this?

    I goofed. Tiring of seeing 'appleuser', I hit Command-I on ‘appleuser’ in Places (left side Finder windows), changed it to my own short login name. No other changes: my account password remains the same. I thought nothing would change but that name. Hah.
    On restart, login went normally and to my surprise I was greeted by the mac as a new account and led through the setup. Hmm. I filled out my ID and password exactly as they were. Then I found myself on a desktop that was all new, stripped of my files. I searched and I found them, and can open them, but they don't 'belong' to the new account. They are still in place (not on the desktop though) and I can navigate to them but not easily as before. It’s as if they are some other user’s. My mac is set to ignore permissions: I am the sole user.
    Short of reinstalling Leopard, and Time Machine is not an option, how do I get my mac to return to the previous state before I upset the applecart, I mean 'appleuser'?

    flyng wrote:
    I goofed. Tiring of seeing 'appleuser', I hit Command-I on ‘appleuser’ in Places (left side Finder windows), changed it to my own short login name. No other changes: my account password remains the same. I thought nothing would change but that name. Hah.
    this is the wrong way to change the name of your home directory. normally, there is a "deny delete" ACL on it to prevent just these kinds of accidents. did you upgrade from Tiger? users upgraded from tiger don't have those protective ACLs.
    also, by default the name of your home directory is the same as your short login name. you say that "appleuser" is not your shortlogin name. did you change it in the past?
    On restart, login went normally and to my surprise I was greeted by the mac as a new account and led through the setup. Hmm. I filled out my ID and password exactly as they were. Then I found myself on a desktop that was all new, stripped of my files. I searched and I found them, and can open them, but they don't 'belong' to the new account. They are still in place (not on the desktop though) and I can navigate to them but not easily as before. It’s as if they are some other user’s. My mac is set to ignore permissions: I am the sole user.
    Short of reinstalling Leopard, and Time Machine is not an option, how do I get my mac to return to the previous state before I upset the applecart, I mean 'appleuser'?
    go to system preferences->accounts. is your old user listed there? if so, unlock the lock at the bottom, control-click on your old user and select 'advanced options". in the resulting popup look at the entry for home directory. does it say /users/appleuser? if so change it to /users/username where username is the short user name of you main user. look in /Users and make sure that your old home directory does have this name. then log out and log in as the old user.

  • How should I fix this one Flash mp3 player problem?

    First of all, I'm just learning Flash, so bear with me. To deliver music content on a little website, I'm using the original Fabricio Zuard XSPF_player from Sourceforge.net. The version of the player that plays more than one song is supposed to also display the relevant album cover on the left. This works fine with FireFox 3.6, IE 8, and Opera 11 (all on Windows XP Pro sp3).
    But on Google Chrome, the song links go all the way to the left including the space where the cover image should be. Can someone more experienced help me diagnose this? One person has suggested a Javascript problem, but the only Javascript I'm using is SWFObject, which appears to have a good reputation, and doesn't have anything to do with the player's internal appearance.
    http://www.keithpurtell.com/kthings/bruce.htm

    As you suggested, I used Flash (CS5) to publish an html. Tested in Firefox the cover is shown, but tested in Google I still get only the links to the songs. Can you suggest my next step?
    http://www.keithpurtell.com/kthings/test/xspf_player.html

  • HT203167 I downloaded Marvin Gaye Numberones and only 7 seconds of You're All I Need To Get By downloaded. How should I remedy this?

    I purchased Marvin Gaye Numberones and only 7 seconds of the song You're All I Need To Get By plays. It doesn't seem to have downloaded correctly. What should I do to correct this?

    If your country's iTunes Store allows you to redownload purchased tracks, I'd delete your current copy of the track and try redownloading a fresh one. See the following document for instructions:
    Downloading past purchases from the App Store, iBookstore, and iTunes Store
    Otherwise, I'd report the problem to the iTunes Store.
    Log in to the Store. Click on "Account" in your Quick Links. When you're in your Account information screen, go down to Purchase History and click "See all".
    Find the item that is not playing properly. If you can't see "Report a Problem" next to the item, click the "Report a problem" button. Now click the "Report a Problem" link next to the item.

  • My software update is complete but it appears that my Java is not working, how should I correct this?

    I'm trying to upload my pictures to a different site which requires Java.  I checked Java.com which states that Apple has it's own version of Java, but my computer will not allow me to upload my pictures even though my software is updatede.  Does this mean I don't have Java? If so, how do I get it for my laptop?

    you can try this,  on your phone, go to the app store, hit the update button on the bottom, then click on purchase, you will then see 2 tabs all/or not on this phone.   Look and see if your app is there, if it is hit the cloud icon next to it and it will download to your home screeen.

Maybe you are looking for

  • My IPod touch not connecting to computer or itunes, it only charges

    I Have an IPod touch 4g and when i plug it in the computer, it charges but it doesnt connect to Itunes or My computer? Ive tried using a different cable there was no difference, I tried pluggin it in a different computer, still the same problem, rebo

  • Load Balancing -- preserve client IP?

    Does the Flash Media Streaming Server need to know the client's IP address in a load-balanced environment?  We will be doing straight-forward hardware load balancing -- we are not architecting the cluster for communication between Flash Media Servers

  • Which Camera Calibration Profile for Leica M8 with LR3?

    I see there are 4 camera profiles for the Leica M8 that all produce significantly different results - ACR3.6 and 4.4 and Adobe Standard and Camera Standard. Any advice on which to use and when? Thanks in advance.

  • SLOWWWW Iweb website

    Is it me or are iWeb websites just much slower than others.... particularly if you want a website with lots of photos. I built one with many photos but just couldn't get it to download quickly enough.... so I removed all photos and just had one welco

  • TagAttributeInfo

    Hi,           I wrote my own tag library and put it all under the WEB-INF directory.           It compiles fine but at run time I get the following stacktrace :           java.lang.NoSuchMethodError: javax.servlet.jsp.tagext.TagAttributeInfo: