Advice on nextInt(int maxSize) please :(

aHedges told me to use the method nextInt(int maxSize) to generate random integers. How can i use this method to make all elements of an arry generate random numbers? I understand the answer is simple but i busted my buns without any result. Please help :(

Do you mean:
java.util.Random rand = new java.util.Random();
int[] myArray = new int[10]; 
for (int i = 0; i < myArray.length; i++) {
    myArray[i] = rand.nextInt(500);
}I haven't tested this but it should be close.

Similar Messages

  • I want to purchase a two terabyte external hard drive to utilise Time Machine on my new iMac....but which one? Western Digital, Time Capsule, Seagate? Any advice would be most welcome please.

    I want to purchase a two terabyte external hard drive to utilise Time Machine on my new iMac....but which one? Western Digital, Time Capsule, Seagate? Any advice would be most welcome please. Thanks Phil

    If you are looking for high quality drives and enclosures I'd recommend these 3:
    http://g-technology.com/products/g-drive.cfm
    http://www.lacie.com/us/products/product.htm?id=10330
    http://eshop.macsales.com/shop/firewire/1394/USB/EliteAL/eSATA_FW800_FW400_USB
    I use the LaCie's, I've got three connected to my system and a 4th acting as my TM drive on my MacBook Air. Any of the above would be welcome on my desk though.

  • Hi all, just finished my course on Sap Hr, any advice on where to start please?

    Hi all, just finished my course on Sap Hr, any advice on where to start please?

    Hi Ish ghandi,
               Welcome to the World of SAP
            HCM as a whole is a vast module SAP which have so many sub modules in it. The selection of a particular sub module and specializing  in that is according to your interest. PA and OM which is the base for a HCM functional consultant. Then you want to specialize in other sub module like Time,Payroll,TEM,ESS/MSS,Etc..,
    Please follow the careers in SDN which will be helpful for you in career.So Many Expertsa are here for Helping you . Have a Nice Journey...
    Career Center
    Once again Warm Welcome...
    Thanks,
    Vijay SR

  • URGENT advice needed on labels/textfields please!!

    I have been trying for days to add labels and textFields to my applet and can only manage to display one.
    My assignment instructions suggest I use makeTextField method and call the setEditable method from the makeTextField method to avoid repetition of code.
    The following is my code...I must have this done in the next couple of days so if someone could please please give me some assistance it would be really appreciated....also, thoughts on my layout would be great as well...i cant seem to set up my buttons in the correct order.
    import java.awt.*;
    import java.awt.event.*;
    import java.applet.Applet;
    public class Registry4b extends Applet implements ActionListener {
    public void init() {
    backgroundColor = new Color(200,255,255);
    this.setLayout(new FlowLayout(FlowLayout.CENTER,4,1));
    makeButtons();
    row1 = makePanel(new FlowLayout(FlowLayout.LEFT,4,2),backgroundColor);
    row1.add(clearB);
    row1.add(studFindB);
    row1.add(studForB);
    row1.add(courB);
    row2 = makePanel(new FlowLayout(FlowLayout.LEFT,4,2),backgroundColor);
    row2.add(studBackB);
    row2.add(courFindB);
    row2.add(courForB);
    row2.add(studB);
    row3 = makePanel(new FlowLayout(FlowLayout.LEFT,4,2),backgroundColor);
    row3.add(courBackB);
    add(row1);
    add(row2);
    add(row3);
    Panel p = new Panel(new BorderLayout());
    Label studID = new Label("STUDENT ID");
    TextField entry = new TextField(" ");
    p.add(studID,BorderLayout.WEST);
    p.add(entry,BorderLayout.CENTER);
    Label firstTF = new Label("FIRST NAME");
    makePanel(new BorderLayout(2,2),backgroundColor);
    add("West",courBackB);
    add("East",studB);
    makePanel(new BorderLayout(2,2),backgroundColor);
    add("North",p);
    add("South",courForB);
    makePanel(new BorderLayout(2,2),backgroundColor);
    add("North",courFindB);
    add("South",studBackB);
    makePanel(new BorderLayout(2,2),backgroundColor);
    add("West",p);
    add("East",studForB);
    setBackground(backgroundColor);
    clearB.addActionListener(this);
    courBackB.addActionListener(this);
    studB.addActionListener(this);
    courForB.addActionListener(this);
    courFindB.addActionListener(this);
    studBackB.addActionListener(this);
    courB.addActionListener(this);
    studForB.addActionListener(this);
    studFindB.addActionListener(this);
    private Label makeLabel(String label) {
    Label label1 = new Label(label,Label.RIGHT);
    label1.setFont(new Font("Courier",Font.BOLD,10));
    return label1;
    public void start() {
    appletWidth = 8*4+row1.getSize().width;
    appletHeight = 8*(2+courBackB.getSize().height);
    public void paint(Graphics g) {
    setSize(appletWidth,appletHeight);
    validate();
    public void actionPerformed(ActionEvent e) {
    String s = (String)e.getActionCommand();
    private Button makeButton(String label, Color color, Font font) {
    Button b = new Button(label);
    b.setBackground(color);
    b.setFont(font);
    return b;
    private Panel makePanel(LayoutManager lm, Color c) {
    Panel p = new Panel();
    p.setLayout(lm);
    p.setBackground(c);
    return p;
    private void makeButtons() {
    Font f = new Font("Courier", Font.BOLD, 10);
    Color grey = new Color(255,100,100);
    clearB = makeButton("CLEAR",grey,f);
    studB = makeButton(" STUDENTS ",grey,f);
    studForB = makeButton("->",grey,f);
    studFindB = makeButton("FIND",grey,f);
    courFindB = makeButton("FIND",grey,f);
    studBackB = makeButton("<-",grey,f);
    courB = makeButton(" COURSES ",grey,f);
    courBackB = makeButton("<-",grey,f);
    courForB = makeButton("->",grey,f);
    TextField addressTF = new TextField("ADDRESS", 10);
    static final String initialString = " ";
    String Filler = " ";
    Panel row1, row2, row3, p1;
    int appletWidth, appletHeight;
    Button clearB, studForB, studFindB, courFindB,
    studBackB,courB, courBackB, studB, courForB;
    Color backgroundColor;
    thanks in advance for anything someone can do for me

    that works fine
    all labels and buttons displayed
    a note on layouts NEVER use flow layout
    for simple layouts(like this) use a combination of grid and border layouts

  • Request for advice on best Network Architecture please

    I have a first generation Time Capsule (-n), a first generation Airport Extreme Base Station (-n), an Airport Express (-g), and an ISP supplied cable modem/wireless router ("Netgear Cable Wireless Gateway") which has 4 ethernet ports.
    I would be very grateful for advice on how best to configure a network(s) to suit the following needs with best achievable speed throughout please:
    1) Internet access for n-capable 2010 iMac (wired is fine), together with Time Machine backup to Time Capsule.
    2) Internet access for n-capable 2008 MacBook Pro (wired most of the time is fine, but occasional Wireless), together with Time Machine backup to Time Capsule.
    3) Internet access for iPad 2 (Wireless)
    4) Internet access for iPhone 4 (Wireless)
    5) Internet access for iPhone 3G (Wireless)
    6) Access for all the above devices to printer connectable by ethernet only (no integral WiFi)
    7) Airplay access for all the above devices to iTunes library on iMac, to play through speakers connected to Airport Express (-g).
    8) Ad hoc WiFi internet access (with password) to visiting -n and -g capable devices (laptops, smartphones etc.) to maximise network speed available to above devices (ie. I don't want visiting devices to slow down the network available to my devices, listed above).
    9) Back to my Mac remote access to iMac/Network via the internet from MacBook Pro when I'm away.
    Where possible, if I can use the devices I have to boost network strength throughout the house, this would be a bonus.  Needless to say, I am keen to make my network as secure as possible, particularly the remote access aspect, so am happy to grant access to specific MAC addresses only.
    The computers are running 10.7.2, the iPhone 4 and iPad 2 run iOS 5.0.1, the iPhone 3G runs the latest version of iOS 4.  I have Airport Utility 5.5.3.
    I am a complete beginner, and am new to terms like NAT, bridged etc., so please be gentle with me, and explain in the simplest possible terms, starting from the beginning!  If you could detail where I physically need to connect devices with a cable or rely on a wireless connection, that would be a big help.
    Thank you for taking the time to read this far!  Looking forward to hearing from some of you networking gurus!
    Best regards

    oh, and I also have two LaCie NAT drives with ethernet connections which I'd like to be able to access from the iMac and the MacBook Pro...
    Thanks!

  • Double to Int Help Please

    Ok, so, now, I am about to take my final in Java on Thursday, and I thought I would try a little prog on my own. But, I am having trouble with the most basic stuff!
    Here is prog: http://www.willdesign4you.com/BindingCalc.java
    I have two issues:
    1. In this segment:
    if((numStrips % 10) > 0)
    output.append("\n(Number of Strips needed has been rounded up " +
         " to nearest 1.)");
    numStrips += 1;
    the method works fine unless the result is like 10.05 or in that range, then it isn't performing the function.
    2. In the rest of the methods, I need to be able to do math functions in decimals to get the needed accuracy. But, I cannot use * with a double, and I can't use int for double or float numbers. What am I doing wrong?
    What I need to do at the end to calculate yardage is say something like this:
    Yardage = numStrips * StripWidth
    Round up Yardage to the nearest 1/4" yard.
    Can anyone help me please?
    Thanks,
    Kimberly

    Sorry! Forgot!
    Maybe you should have a look at the BigDecimal and BigInteger classes. Using them you can perform a number of operations. The example I gave before do not perform any roundings. So, if d = 123.56 i will still be 123.
    Klint

  • Some advice for a prospective user please.

    Hello, I have been looking through some of the documentation
    on the Adobe web site and I have read several posts that have
    answered some of my questions but I just want to be certain that
    Contribute is the product that I need, or rather my client needs,
    for a web site that I am making. Thank you very much for any advice
    that you can give, I apologise if my questions are tedious and you
    have answered them before, by all means refer me to another post
    that is relevant to my questions.
    Um... I am making a web site in Dreamweaver. Can I upload the
    web site in the same way as I would if I was not using Contribute
    and then allow someone else to come along and edit the page using
    this software? Or put another way; can you use contribute to edit
    any page on the web providing you have the appropriate access?
    I read in another post that the designer does not have to own
    Contribute, only the client who will be editing the site does. What
    I want to make sure about is that as the designer I will not have
    to do anything different to what I would normally do and all of the
    Contribute use is at their end.
    Thank you very much for your help. It is much appreciated.
    Kind regards,
    Adam.

    ADAM BURTON wrote:
    > Hello, I have been looking through some of the
    documentation on the Adobe web
    > site and I have read several posts that have answered
    some of my questions but
    > I just want to be certain that Contribute is the product
    that I need, or rather
    > my client needs, for a web site that I am making. Thank
    you very much for any
    > advice that you can give, I apologise if my questions
    are tedious and you have
    > answered them before, by all means refer me to another
    post that is relevant to
    > my questions.
    >
    > Um... I am making a web site in Dreamweaver. Can I
    upload the web site in the
    > same way as I would if I was not using Contribute and
    then allow someone else
    > to come along and edit the page using this software? Or
    put another way; can
    > you use contribute to edit any page on the web providing
    you have the
    > appropriate access?
    >
    > I read in another post that the designer does not have
    to own Contribute, only
    > the client who will be editing the site does. What I
    want to make sure about is
    > that as the designer I will not have to do anything
    different to what I would
    > normally do and all of the Contribute use is at their
    end.
    >
    > Thank you very much for your help. It is much
    appreciated.
    >
    > Kind regards,
    >
    > Adam.
    >
    Hi Adam,
    To answer your first question:
    Yes, Contribute can connect to the same remote site that you
    use with
    Dreamweaver, and you're exactly right that it can be used to
    edit only
    those pages the Contribute user has permissions to. In my
    company I'm
    the only person using Dreamweaver, as the site administrator,
    and
    everyone else uses Contribute. My use of Dreamweaver is
    basically to
    create templates and make some changes that aren't possible
    in
    Contribute (such as folder renaming and mass file deletion),
    but any new
    pages I create using Contribute as well, though I could use
    Dreamweaver.
    for your second question:
    I'm not really sure. My setup uses Contribute Publishing
    Server (CPS)
    and this connect to Active Directory, allowing me to assign
    users to
    roles within Contribute. Now, while Dreamweaver does let me
    administer
    the website using Contribute screens, I don't know if I could
    do this
    without Contribute installed on the same PC (which it is).
    Possibly,
    Yes.. but I don't know.

  • Needing some advice on Adobe Export PDF, please??!!!

    So I am rying to use Adobe ExportPDF and I keep repeatedly get the same errors that Internet Exlporer has quit working and we are trying to solve the problem.....I am not sure what I am doong wrong - seemed easy enough.
    Any advice would be greatly appreciated!
    Thanks!

    Good day,
    Try the solutions outlined in this document: Troubleshooting Common Problems with ExportPDF.
    Kind regards,
    David
    Adobe Systems

  • So i just got the Mac Book Pro and i kind of wanna return it for the iPad? any advice on what to do please help

    i just baught the mac book pro and i wanna play games and the games are like really expensive. should i return it to get a ipad ? suggestins please help

    Take it back and see what can be arranged. This isn't anything we can assist you with. You have 14 days after purchase to return for a replacement.

  • When my Itunes is downloaded in my computer and I review my account and there is a payment and the option of no payment is not int there Please tell me what to do

    I download Itunes in my computer and when I sign in I know that you should pick a payment and I want to click in the no payment but there is maybe a glitch I waited for a day and there is still no button of thr no payment please fix that please

    Changing your payment information using a computer
    Open iTunes.
    Choose Store > Sign In.
    Enter your Apple ID and password and click Sign In.
    Choose Store > View Account.
    Enter your account password and click View Account.
    From the Apple Account Information page, click Edit to the right of Payment Type.
    Note
    : You can find the payment methods that the iTunes Store accepts in the Payment Type section. If you don't want a payment method on your account, select None in the Payment Type section.
    Click the Done button after you've updated all of your information.

  • Need advice on Unity Voice Mail Please

    Chaps.
    Around 4 years ago, i inherited a CCM v4 as part of a business relocation.
    I've had no formal training on CCM, so everything i know, I've taught myself.
    The system includes a Unity VM server, which until today has been switched off, as we've had no previous use for it.
    I'm now trying to get my head around how it works.
    I've created a user profile in Unity Admin, and allocated a log in as 5321, with password 12345.
    There appears to be a number of lines in to the Unity server starting ext 8000 through to 8016, each of which answers with  "Hello, Cisco Unity Messaging System, you can dial an extension at anytime."
    I dial 5321 and leave a message in the mailbox.
    If i log in to 5321 with the password I can retrieve the message.
    So it seems that Unity is working OK.
    What i'm struggling with, how would an end user divert all thier calls to 5321.
    The way i see it at the moment, is that who ever is calling me would need to know either the ID (5321) or the name.
    I'd like the end user to be able to divert all thier calls using "CFwdAll" to thier respective mail box, but not sure how to do this ?

    No, that is not correct. You should not be dialing those 8XXX numbers directly. Those numbers are tied to the VM Ports that connect the Unity server with CUCM. Depending on your licensing on the Unity server, you have a certain amount of VM Ports. The VM Ports are used for taking calls, setting message waiting indicators and TRAP connections. Below I will try to explain this process.
    1 - Create VM Ports and assign an extension.
    2 - Assign these VM Ports to a Line Group.
    3 - Assign the Line Group to a Hunt Group.
    4 - Assign a Hunt Group to a Hunt List.
    5 - Assign a Hunt List to a Hunt Pilot. You would then assign the Hunt Pilot with an extension. This extension is what is dialed to reach the Unity server.
    6 - You create a VM Pilot with the same extension that you assign the Hunt Pilot.
    7 - You create a VM Profile and assign it the VM Pilot. You have the option to make this VM Profile the default for the system, which is why you would only see "Default or None" under a Directory Number.
    8 - Assign a VM Profile to a users DN.
    When you create users in Unity you assign the users with their extensions. When the users dial into the Unity system, Unity sees their extension and if it matches a configured user, it will play the login prompt.

  • Some advice and help with sound please

    i have just upgraded! to premier elements 8. when i import a dvd all the sound plays when viewed on the preview but as soon as i drag it down to become the next clip everything is heard (background music, dogs barking chit chat etc) except the voices of the actors. any suggestions would be appreciated. of course just to frustrate me it doesn't happen on all clips

    This is extremely odd, as if all of the sounds are heard in the DVD, you are working with that mixed Audio Stream. PrE does not break this apart, i.e. un-mix the Stream from the DVD.
    When played on either a computer through DVD player software, or on a TV through a set-top player, do you hear all frequencies?
    When you have Imported the VOB, do you hear everything in the Source Monitor?
    Are you saying that when you drag the Clip to the Timeline, suddenly the frequency ranges of human speech disappear? That is very, very hard to accomplish with a professional Audio editing program, let alone have it happen automatically and accidentally in PrE.
    Good luck,
    Hunt

  • My i hpone 5 has frozen while doing update. Can anyone give any advice on how to rectify please

    I have tried doing latest update and phone now frozen is anyone able to advise on how to get phone working again. many thanks

    Reset the phone by holding the sleep and home button for about 10sec, until the Apple logo comes back again.
    If this does not help, connect in recovery mode and restore, explained here:
    If you can't update or restore your iOS device

  • I need good advices for a Nokia N95 please...

    I'm going to buy a Nokia N95 from a GSM Store near me and I wish to check first if the phone it's original. I know that there are some things I must check ( The star *, the seventh and eighth digit from IMEI, the size of the camera, if there is written Nseries on the back of the phone,under the Nokia logo) but anything else I don't know....so is there anything that I can check which is only, and only  for Nokia original phones....something that the replicas don't have? I'm asking this because I deeply want not to get hoaxed.
    Thank you so much for your help,
    David

    look carefully under the battery where it was make if its not Hungary or Finland it might be fake...
    look at the menu and touch the landscape menu and there you can see if it works good or its a fake..I had an N95 and it was made in finland at everything was ok it was original but before i bought it I payed attention at battery, production country, camera settings and qualitty, the slide and the quality of screen..If its fake you can observe pixels on the screen faster then at the original phone...
    I hope this would help you

  • Opinions and advice on pocket camera video please

    Just bought a Flip UltraHD pocket camera. For the money pictures are great when used natively. But having converted the 720/30p pictures to 576/50i (using mpeg streamclip) to include in a PAL DV sequence I'm a bit disappointed by the loss of quality and motion artifacts that the conversion causes.
    Does anyone have any experience of the Samsung U10 pocket camera which does 1080/50p and would presumably be better than the Flip when cut into DV PAL sequence ... wouldn't it?

    Entertainment: it's one of few rewards we receive for contributing here.
    But having converted the 720/30p pictures to 576/50i (using mpeg streamclip) to include in a PAL DV < </div>
    That's an extreme conversion, you're throwing away tons of material during the scale and then trying to create fields from frames so, yes, of course it will look terrible. I'd be looking for more precise conversion applications instead of buying another camera.
    You might want to investigate user forums for those rigs. You will find many more FLip owners who use Final Cut's tools there than you will find FCP users who have Flips here.
    But search the forum for the them camera model, see what shows up.
    bogiesan

Maybe you are looking for

  • How do I get my iMac AirPort to only lock onto my wirless router and not others?

    Everytime I power up my iMac I have to use the AirPort drop down menu to select my Wi-Fi network from a long list. Is there a way to set my Air Port Preferences so that it always only picks up my Wi-Fi signal automatically? Saving me the time form al

  • The material account assignment group is missing in sales Order creation

    Hi Gurus, When creating the sales order the material account assignment group is not copied in the sales order line item.  For eg: when the sales order has 5 line item for one of the line item the material account assignment group is not getting copi

  • Issues with ios7

    hi all i've just uploaded ios7 and i can t receive notifications and imessage is not able to connect. what s the issue? thanks

  • Question about compiled byte code

    Howdy folks, I have a client who wants to run an application in both on-line and off-line modes. The user could run the application locally on their laptop making changes and such which would get stored to local database files (probably FoxPro free t

  • Connect by prior - reverse order

    Is this possible: emp - manager a 0 b a c a d b I can start with the manager = 0 and get the entire tree. I want to start with emp = c and get the tree going the other way .. reverse order. Is this possible ?