Can't figure out why array going out of bounds

This program should take a text file of integers seperated by whitespace and put them into an array. What am I doing wrong?
import java.io.*;
import java.util.*;
public class five{
    public static void main(String[] args){
     try{
         BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
         System.out.print("Enter source filename: ");
         String fileName = br.readLine().trim();
         int[] out = getNums(fileName);
     }catch(Exception e){
         System.out.println(e);
    static int[] getNums(String fileName){
     int[] output  = new int[128];
     int counter =0;
     try{
         FileReader fis = new FileReader(fileName);
         StreamTokenizer stz = new StreamTokenizer(fis);
         int token = stz.nextToken();
         while(token!=stz.TT_EOF){
          if(token==stz.TT_NUMBER){
              int num = (int)(stz.nval);
              output[counter]=num;
              counter++;
     }catch(Exception e){
         System.out.println(e);
     return output;

doh, i can't believe i missed that. fixed the nextToken thing now and it works great. Thanks!

Similar Messages

  • Hi, I can't figure out why I can't render on my timeline. I highlight the segment hit "Apple-R" and it gives me a weird message about "conforming HDV video...." and the bar goes as far as 60-66% and holds there forever. It never renders even partially.

    Hi, I can't figure out why I can't render on my timeline. I highlight the segment hit "Apple-R" and it gives me a weird message about "conforming HDV video...." and the bar goes as far as 60-66% and holds there forever. It never renders even partially.

    Yes, I know. I have been working with HDV for some time. I am wondering why it doesn't render when it needs to.. the red and bright-green lines are above, and I've set the render settings such that ANYTHING I highlight and hit apple-R will render. But its not rendering at all.

  • My podcast isn't updating and I can't figure out why, please help?

    Hi everyone,
    I'm at my wits end and I can't figure out what's wrong with my podcast in regards to iTunes.
    We have a website we update that originally iTunes was pointed at (http://www.whydaddydrinks.net/?feed=rss2) and then iTunes started having issues with not updating. Recently we tried changing the feed of the podcast to the RSS feed for our podcast hosting account at Podbean (http://whydaddydrinks.podbean.com/feed/) and it's running into the same issue.
    I've checked FeedValidator for both feeds and they're fine (http://feedvalidator.org/check.cgi?url=http%3A%2F%2Fwww.whydaddydrinks.net%2F%3F feed%3Drss2 and http://feedvalidator.org/check.cgi?url=http%3A%2F%2Fwhydaddydrinks.podbean.com%2 Ffeed%2F). I've clicked the links to the .mp3 files and they play off the web, so, in theory, there shouldn't be any issue as far as I know; Episode 13 shows up in iTunes but dosn't appear to be connected to the file and Season 2 Episode 1 doesn't show up at all.
    Can any of you offer any suggestions as to what the heck is going on?

    Your Store page is at https://itunes.apple.com/gb/podcast/your-book-is-why-daddy-drinks/id515363310?mt =2
    This is using the feed at http://www.whydaddydrinks.net/?feed=rss2 so the other feed URL you posted is irrelevant.
    This feed has episodes up to 13 which contain playable media, and these all show in the Store and when subscribing. However the URL for the media file for episode 13 is
    http://media40.podbean.com/pb/89ea6f327345e33833ff09885e48b8a1/50e904db/data2/bl ogs48/462271/uploads/YBIWDD_Episode13.mp3
    and there is no file at this address. The previous episode downloads OK.
    This feed contains two later episodes but neither has an 'enclosure' tag containing the URL of a media file and so the episodes don't show in iTunes. You are using WordPress to make your feed, and this problem arises a lot - it presumably means that you have failed to do something you need to do in WordPress to get the media file into the feed, but I can't advise on specifics of WordPress.
    The other feed has one of these two episodes, and there the latest episode does have an 'enclosure' tag and the episode appears when subscribing manually; however as I say this feed is not in use by the Store.
    So you need to do with the original feed whatever it was you did with the new feed to get the episode into the Store, and you need to chase the missing media file for episode 13.
    If you want to move the Store to using the Podbean feed you need to follow the procedure outlined here:
    http://www.wilmut.webspace.virginmedia.com/notes/podcast.html#move
    Note that the title in the Podbean feed is 'whydaddydrinks' which many not be what you want.

  • Apex bug?  Items being cleared in session state - can't figure out why

    I have an item that is being submitted with a value but is then being overwritten and set to null. I can't see any reason why the submitted value is being overwritten with null.
    I have been debugging this problem for most of the day and can't figure out what is happening and was hoping someone in the forum might be able to shed some light.
    Some details:
    The item is on Page 0, has source type of "PL/SQL Expression or Function", a source expression of "V('REQUEST')", and Source Used = "Always".
    I viewed the HTML source of the rendered page and can see the following HTML, so I know the item has a value when the page is rendered:
    <input type="hidden" id="RENDER_REQUEST" name="p_t08" value="EDIT" />
    I have used Firebug to view the HTTP POST body and can see that p_t08 is being correctly submitted with a value of "EDIT" in the post body.
    When I run the page in debug mode and then view the debug log, I see that Apex is indeed setting this item to null:
         0.01500     0.01600     A C C E P T: Request="WIZ_NEXT"
         0.23400     0.00000     Session State: Save form items and p_arg_values
         0.24900     0.01600     ...Session State: Save "BRANCH_TO_PAGE_ID" - saving same value: ""
         0.24900     0.00000     ...Session State: Save "ROWS_PER_PAGE" - saving same value: ""
         0.26500     0.01500     ...Session State: Save "P0_CLEAR_WS" - saving same value: ""
         0.26500     0.00000     ...Session State: Saved Item "RENDER_REQUEST" New Value=""
    I can't figure out why the item is being set to null.
    This problem also does not occur on every page. The pages in question are a multi-step "wizard" that allows the user to navigate between steps with "Next" and "Previous" buttons. Since this is a page 0 item, it appears on every page in the wizard so I'd expect it to behave the same. When you open the wizard at step 1 and press next to go to step 2, the item (RENDER_REQUEST) is set correctly on step 2 of the wizard, BUT when you then click Next to go to step 3, RENDER_REQUEST is null on step 3. If you open the wizard at step 2 and press Next, RENDER_REQUEST is null on step 3.
    I did find a work around, but it doesn't make any sense why it would work: if I move the RENDER_REQUEST item from the "Footer Items" region to a page level item (by using Edit All and setting its region to blank), then the problem goes away. If I move it back to the "Footer Items" region the problem reoccurs.
    I am working on Application Express 4.0.2.00.07 on Oracle Database 11g Enterprise Edition Release 11.2.0.1.0.
    Any help would be greatly appreciated!
    Thank you.

    Hi Patrick,
    Thanks for the quick response. Unfortunately, I can't reproduce this on apex.oracle.com due because the app requires PL/SQL packages to be installed in several schemas, including some that require system grants (I gave a presentation at Oracle Open World a couple of years ago on some of the techniques I used in building this application that you attended; I think the session was called "Building Large Commercial Applications with Oracle Database 11g and Oracle Application Express").
    Is there another way we can work together to debug this without reproducing it apex.oracle.com? For example, if you could send me an instrumented version of the APEX_040000.F procedure (or whatever procedure is clearing the session state) that has some additional APEX_APPLICATION.DEBUG calls, I could install it on my server, reproduce the error and send you the output.
    Thank you,
    Eric

  • Can't figure out why I'm dropping frames during capture

    I'm dropping frames when capturing 1-hour Mini DV tapes and I can't figure out why.
    I'm capturing on a Mac Pro (Early '08) with 8 GB of memory running FCP 7.0.3 and OS X 10.6.6. I'm capturing to a 4 TB G-Speed eS (eSATA) formatted as RAID 5 (Non-Journaled Extended) with about 750 GB of remaining space. I'm capturing via FireWire with a Canon GL-2. This should be a breeze for this system.
    I've run Apple Disk Utility, Disc Warrior 4 and Techtool Pro 5 on the drives and they seem to be fine. I've unplugged all USB and FireWire devices besides the keyboard and mouse. No virus protection or background utilities are running. I've trashed preferences. AJA System Test shows a 286 MB/s write speed and 254 MB/s read speed. Blackmagic Disk Speed Test shows a 312 MB/s write speed and a 379 MB/s read speed. No other applications besides FCP are running. I edit 1080p HD footage on this system all day long with no issues but when I try to capture DV SD footage, I run into issues.
    The dropped frames error does not ever occur in the same place on the tapes. The tapes are brand new and don't seem to have any time code issues. The only thing I haven't done is to defragment the hard drives. I wouldn't think that capturing simple DV video would be that demanding; the defragment for a 4 TB RAID would likely take 2 or 3 days.
    Any other ideas on what's going on and how to try to fix it? Thanks!

    Thanks for the prompt reply, Studio X. Yes, I'm using FireWire Basic and no other FireWire devices. I've switched FireWire cables, although I doubt that's the issue as the cable I was using was brand new and fit snuggly. Unfortunately, I don't have an alternate playback device right now. Would switching to Non-controllable device capture settings be worth a try?

  • I have an iphone5 that is eating up data time and I can't figure out why? Any thoughts?

    I have an iphone5 that is eating up data time and I can't figure out why? Any thoughts? I have closed everyting I can, even took the phone to Verizon and they are not sure what is going on.   My company email is active and pushes to the phone....I use Safari regularly to look up stuff for personal and work use.  I am on Facebook but have turned it off in notifications.  Four phones and a hotspot on the account....we have 6g and have never come close to it, until lately and it's my phone that's eating up the gigs.  So what the heck is going on?

    Go to Settings/Cellular and you can see how much data each app is using. You can Reset Statistics, then track all of the apps data usage.

  • I can't figure out why my reverb and echo things are greyed out

    I can't figure out why my reverb and echo things are greyed out on the bottom right of my screen with the edit tab open for the track. I was going to put a screenshot in here but I couldn't figure it out. I one can understand what I mean. Thank you.

    bennirubber wrote:
    reverb and echo things are greyed out on the bottom right of my screen
    http://www.bulletsandbones.com/GB/GBFAQ.html#effectsdisabled
    (Let the page FULLY load. The link to your answer is at the top of your screen)

  • Can't figure out why my navbar gets all pixelated online?

    Hi Everyone,
    I'm designing a floating site.  My workflow is PS=====>Fireworks====>Dreamweaver.  I made a navbar in FW with a transparent background and exported html to dreamweaver.  I inserted the fireworks htm, put it online and it looks terrible.  You can see it here:
    http://www.njtraininggrounds.com/thirddaydesign.com/identity.html
    Don't worry about the portfolio button, I know what's going on there.  But I can't figure out why there is "stairstepping" on the logo and on all the navbar buttons.  This is the first time I've ever created a floating site.  I just put a jpeg for repeat using the dreamweaver css, and then inserted the rest in a table. 
    Could anyone give me an idea of what I'm doing wrong?  Thanks so much.
    Wil

    There's no problem with using PNG8, PNG24, or PNG32, other than the huge
    weight of the latter two.  But there's no need to go PNG here.
    Personnaly I see only advantages in using PNG. The good thing about using PNG for graphics like this is that it does not tie you to a background with a certain color. like a GIF with a colored matte does. Should you wish to change your background color later you can keep on using your menu buttons. There is no need to prepare new graphics for the menu just because you change a background color or image.
    As for the "huge" weight of the PNG file, I'd say that depends on your definition of "huge"
    If you compare the filesizes of a simple graphic like that, I see no big improvement by using GIF.
    see screenshot:

  • I can't figure out how to get my music to shuffle on my iPhone 5s. If I try to skip a song, it skips about 100 songs. It only ends up playing 4 or 5 songs then goes back to the song menu. Help please!

    I can't figure out how to get the music on my iPhone5s to shuffle. If I use the arrows to skip a song, it shuffles through a handful of the same songs then goes back to the song menu. Help please!

    Un-sync all your music to remove it from the device, then restart (hold down the home button along with the sleep/wake button until you see the apple, then let go). Now re-sync your music.

  • How do i synch my pdf/books to my library. I was able to synch my ipod touch purchases by transferring them but can't figure out how to do my pdfs. Also why is my ipod picture greyed out-the one that lets my move the icons around.

    How do i synch my pdf/books to my Itunes  library. I was able to synch my ipod touch app purchases by transferring them but can't figure out how to do my pdfs. Also why is my ipod picture greyed out-the one that lets my move the icons around.
    I am afraid if i don't get the pdfs into my book library, i will lose them when i update to IOS 5-is that true?

    thank you-i have to check into the authorization and the account-i gave my husband my old ipod when i updated last year so both at one time have been on this computer but as it stands, it only comes up with my device when i plug into Itunes.
    i don't think i have any restrictions for installing apps although my normal way of doing it is to download from the ipod touch. i did find that all i had to do was right click on my device name and got the message to transfer my apps and then they showed up in my library. Also when i clicked the synch checkbox i was able to view the ipod touch picture without it being greyed out. after all that i was able toupdate to IOS 5 successfully except my videos and podcast, and pdfs  did not come over. This confuses me since i had dragged them over to my library to make sure that i had everything in my library and on my device. Not a big problem, since i just dragged them in itunes from my library to my device but sometimes i wonder if i understand the big picture:)

  • I'm staying at my house in Peru, South America. From my PC laptop I can see my neighbor's wifi service network, but I also have my mini iPad and I can not figure out why I can't get any wifi connection from my area. Is there a setting I need to do?

    I'm staying at my house in Peru, South America. From my PC laptop I can see my neighbor's wifi service network, but I also have my mini iPad and I can not figure out why I can't get any wifi connection from my area. Is there a setting I need to do?

    Yes, I did try to go on my settings>wifi and was waiting for any wifi signals to pick up, but nothing shows up. But on my PC I get a whole list of networks to choose from. Regarding my neighbor, I already have her password that is why I was able to get it on my PC, the problem is that the mini Ipad is not picking any signal neither can it locate me when I go to maps.

  • I have Pages 09 and I have  created a business card using the template but can't figure out how to duplicate it to the other 9 on the page Am and sure I am going to look daft coz its only the click of a button but I can't work it out Thanks

    I have Pages 09 and I have  created a business card using the template but can't figure out how to duplicate it to the other 9 spaces on the page. I am and sure I am going to look daft coz its only the click of a button but I can't work it out Thanks

    I do the following: Hold down the command key and highlight all the items to be reproduced. Then hold down option and drag the items from the first to each subsequent card.

  • My Macbook Pro 2014 ran out of battery while mid-slideshow. Now the slideshow won't skip through photos and I can't figure out why? Macbook Pro 2014 13-inch Intel i5 8GB RAM 128GB flash, iPhoto library is on external HDD

    Macbook Pro 2014
    13-inch
    Intel i5
    8GB RAM
    128GB flash SSD,
    Integrated Graphics
    iPhoto library is on external HDD
    I was in a slideshow, with around 1,911 photos in it. About halfway through, my Macbook ran out of battery. Now when I restarted and charged the Macbook and reopened iPhoto, the slideshow won't advance through photos, and I can't figure out any reason why it would do this.
    I thought it may be corrupted, so I deleted and reinstalled iPhoto library, iPhoto itself, and disconnected and reconnected my external HDD.
    This didn't work, the photos still won't advance.
    I don't know any reason why this would be happening, and there is ample space on my internal drive.
    I'm happy to provide more information if needed!
    Many Thanks,
    James

    Make a few tests, James, to narrow down the problem and find out, if the slideshow is corrupted, your iPhoto Library, or settings in your account.
    To test, if only your slideshow has a problem, create a new slideshow, just for testing. Just use "File > New Slideshow" and add a few photos. Does this slideshow play correctly?
    If the test slideshow does not play either, create a new iPhoto Library. Use the File menu in iPhoto: File > Switch to library > Create New. Import a few photos and create a slideshow.  Does it play?
    If even a new library does not solve the problem, test in a different user account (see this document:  Isolating an issue by using another user account - Apple Support):   
    This process involves creating a new user account, logging in to it, and testing for the issue.
    Create a new standard or admin user account in Users & Groups preferences.
    Use these instructions for OS X Mavericks.
    See these instructions for OS X Mountain Lion.
    See this video, or these instructions for OS X Lion.
    Optional: If you have any specific files you wish to test with, copy (don't move) those items to the /Users/Shared folder in the Finder.
    Log out of your current user account by choosing Log Out from the Apple () menu.
    Log in with the new account you created.
    Attempt to reproduce the issue you were seeing in your regular user account.
    After you have completed testing, log out of the test account by choosing Log Out from the Apple () menu.
    Log in as your regular account.
    After you have completed all testing with the test user account, you may want to delete it. You can delete an account in the Users & Groups pane of System Preferences.
    Note: Prior to deleting a test account, make sure you are completely done with it. If you have files in the Guest User you wish to keep, you should copy them to the /Users/Shared folder .
    If you should find, that slideshows only play in a new user account, post back.

  • Can't figure out why colors don't totally change when you select type with curser? It looks like it has by looking at it, but when you highlight the area after the old color is still there. It happens with objects to. Driving me NUTZ. Help!

    Can't figure out why colors don't totally change when you select type with curser? It looks like it has by looking at it, but when you highlight the area after the old color is still there. It happens with objects to. Driving me NUTZ. Help!

    Select the text, and open the Appearance palette (Come on guys, text highlight is irrelevant, it happens to objects too says the OP), and see what's listed there.  For a simple text object, there should only be a line item "Type", followed by "Characters", and when double-clicked the Characters line item expands to tell you the stroke and fill color.  For a basic object, there should be a fill and/or stroke.
    What happens sometimes, is that you end up adding extra strokes/fills to objects or text, and the appearance palette is where that will be noted.  Especially when you are dealing with groups, and/or picking up a color with the eyedropper, you may inadvertently be adding a fill or stroke on top of something.  You can drag those unwanted thingies from the Appearance palette into its own little trash can.

  • I tried to Skype someone but I can't see them but they can see me and I can't figure out why?

    I tried to Skype somebody and they can see me but I can't see them and I can't figure out why?

    I'll guess that you're upgrading from Snow Leopard? You should be able to start using your original install dvd by inserting the disc and restarting while holding the C key. Run Disk Utility from your install disc  and try to repair the drive. Then try the upgrade again.

  • I have lost my "Basic" panel in the Develop module and can't figure out how to get it back. My right panel goes from the Histogram straight to the Tone Curve panel.  My Basic panel should be below the Histogram.  Any ideas how to get it back.  I have even

    I have lost my "Basic" panel in the Develop module and can't figure out how to get it back. My right panel goes from the Histogram straight to the Tone Curve panel.  My Basic panel should be below the Histogram.  Any ideas how to get it back.  I have even uninstalled my lightroom and reinstalled it with same issue.  Help!!!

    Right click on or near one of the other headers and a pop-up will appear and you will be able to select the Basic Panel for viewing.

Maybe you are looking for

  • Dotted Strokes not exporting to pdf (InDesign CS3).

    I'm producing a booklet in CS3 where I've used a lot of dotted strokes (both as decorative lines, and as outlines to background panels beneath text). When I export to pdf, I'm finding that all the spreads that contain these elements come up blank wit

  • Is there a manual for the Razr M???

    I am new to smart phones. I admit that right away. But I follow instructions really well. The starting instructions for this phone don't help, as they are incomplete. For example: When I try to do what it tells me, as in getting a couple of widgets o

  • NoClassDefFoundError when accessing outside class

    In my iView I need to reference to a class from a different package. I get NoClassDefFoundError exception trying it. I have a SharingReference for that package in my portalapp.xml: <application-config> <property name="SharingReference" value="myPacka

  • Append Hint in Oracle

    Hi All, Any thoughts on why we get redo generated during a Insert operation with /*+ APPEND */ hint when having the DB in archive log mode. And same statement generating very very less redo when the DB is in no archive log mode. Is the redo generatio

  • Firmware update question

    Does anyone know if it is only possible to update the firmware on macbooks from within the OS? or is there some kind of audit mode as there is with winxp? Reason I'm asking is that when the HDD is changed we are currently having to reinstall the OS,