Help, the last part of my file goes missing

I am adjusting my file so it fits a certain length. for example, 20 characters per line (the length is not fixed). I broke down the file into words and put it in an Arraylist(al), I check the length of the line and add a word if it is not over the limit then put the line in another ArrayList(adjLines) if the next word will cause it to exceed the limit. It is doing the job except for the last line where some words get cut-off so I'm wondering, what did I overlook in my code???
StringBuilder str = new StringBuilder(maxLength);
          String temp = "";
          int idx = 0;
          while(idx < al.size())
               temp = al.get(idx);
               if ((str.length() + temp.length()) <= maxLength) // FIX ADJUSTMENTS HERE!!!!!!!!!!
                    str.append(temp + " ");
                    idx++;
               else
                    adjLines.add(str.toString().trim());
                    str.delete(0,str.capacity());
             adjLines.add(temp)

Change the last line toadjLines.add(str.toString().trim());db

Similar Messages

  • When i sync my iphone5 on my computer with itune the last part does not stop sync download safari i dont know why is not sync and i cant stop it i am try to download some song and this thing cant stop sync help?

    when i sync my iphone5 on my computer with itune the last part does not stop sync download safari i dont know why is not stop sync and i cant stop it i am try to download some song and this thing cant stop sync help?

    Hi,
    /Users/sarahschadek/Desktop/Safari.app/Contents/MacOS/Safari
    Move the Safari app from the Desktop to the Applications folder.
    Restart your Mac.
    That's why you see this:
    When I try to do the updates my computer says it has ready it goes through like it is downloading them then at the end it says some of the files could not be saved to "/" files.
    After your restart your Mac, click the Apple  menu (top left in your screen) then click:  Software Update ...
    Carolyn  

  • I just buy a imac 27inch when after intalling everthing for windows 7 and all the drivers i need and goes to the restard part my imac just goes to a black screen with a blinking cursel and it just wont proceed anyone can help me with this?

    i just buy a imac 27inch when after intalling everthing for windows 7 and all the drivers i need and goes to the restard part my imac just goes to a black screen with a blinking cursel and it just wont proceed anyone can help me with this?

    Support articles for things like this would be here:
    http://www.apple.com/support/bootcamp

  • CAN SOMEONE PLEASE HELP ME? I HAVE BEEN TRYING TO RESTORE MY IPHONE FOR THE LAST 6 HOURS AND EVERYTHING GOES THROUGH OK UNTIL IT GETS TO THE RESTORING IPHONE SOFTWARE, IT LOADS 1/2 THEN FREEZES. IVE LEFT IT LIKE THAT FOR AT 30MINS AND NOTHING HAPPENS. IVE

    HI THERE,
    CAN SOMEONE PLEASE HELP ME? I HAVE BEEN TRYING TO RESTORE MY IPHONE4 FROM IOS 4.3.3 TO 5.1.1 FOR THE LAST 6 HOURS AND EVERYTHING GOES THROUGH OK UNTIL IT GETS TO THE RESTORING IPHONE SOFTWARE, IT LOADS 1/2 THEN FREEZES. IVE LEFT IT LIKE THAT FOR AT 30MINS AND NOTHING HAPPENS. IVE TAKEN THE CORD OUT AND HAD TO TURN PHONE OFF AND RESTART, THEN LOAD IT BACK UP TO ITUNES ALL OVER AGAIN. MANY TIMES!!!!! IVE CHANGED CORD AND USB STILL NOTHING? IVE GOTTEN TO THE POINT WHERE I MAY HAVE RUINED IT ALTOGETHER AND NEED TO BUY A NEW PHONE? PLEASE I HOPE SOMEONE OUT THERE CAN HELP?:
    MANY THANKS

    You may not get a response as you are shouting at everyone.
    All caps indicates shouting, is considered rude, and is difficult to read.
    Many will not read such posts.
    Try turning off you caps lock and asking again.

  • Why is the last part of the Word Press install not working?

    I am installing Word Press to work in Dreamweaver. I have installed MAMP and everything is working fine, I assume. The location of the files are /applications/MAMP/htdocs/wp-content/themes/twentyten.
    I have installed PHP/MySql on my machine and have set up the wordpress database as instructed. The last part of the process has me bogged down. In following step one of the process, I get a blank screen. Here's the url: http://localhost/wp-admin/install.php and the instructions to complete the process.
    With the WordPress files copied to the correct location in the htdocs folder, the web server installed, and a database created, open a browser and browse to http://localhost/wp-admin/install.php.
    A screen telling you to create a configuration file will appear. Click the Create a Configuration File button.
    Click the Let’s Go button to go to a page that allows you to enter your database information.
    Type your database name, wordpress.
    Type your MySQL user name and password (usually the user name and password are both admin, unless you changed them in the database).
    For the Database Host type localhost.
    Click Submit
    Can anyone help?
    Thank for your help,
    GWalton55

    I'm stuck installing virtualhosts in DW and using Wordpress templates, but I may be a few steps further than you are, so I'll try to help. I'm also using Windows, so who knows?
    I'm assuming you are not using a virtual host, just a local host; therefore, I went to the section that has instructions for the steps you are on in David Powers' "Adobe Dreamweaver CS5 with PHP: Training from the Source" and right after he has you launch the browser and open "wordpress/wp-admin/install.php" in "your [site name here] site." He goes on to write:
         The URL depends on how you set up your testing environment:
    Virutal host: http://[site name here]/wordpress/wp-admin/install.php
    Localhost: http://localhost/[site name here]/wordpress/wp-admin/install.php
    NOTE: if you are using the MAMP default ports on a Mac, add :8888 after [site name here] for a virual host, or after a localhost.
    So perhaps that's what you're missing, I really don't know.
    Good luck!

  • Elements 9 Projects plays fine on computer however when burned to a DVD it drops the last part

    Hello,
    this is my first post and first Question ever on Adobe site. I hope thatt someone can help. I have used Elemenys 3.0 for a number of
    years. I have now upgraded to Elements 9. I am having an odd problem with a project that I am working on. Everything seems to be OK on the EDIT
    and on  the DVD PREVIEW mode ; However when burned to a DVD, I am loosing the last part of the project, and the laat  scene button does not take me to the correct scene, It takes me to the one just BRFORE it. When the burning process is done, it shows that it all went well. No error messages. Does anyone have any thoughts as to what is causing this?

    hi photonutguy,
    Since your question is about burning your video to a DVD disc, it is actually an Adobe Premiere Elements question. This forum is specifically about Photoshop Elements and is frequented by people who use Adobe Photoshop Elements for their photos.
    there is a separate forum for Adobe Premiere elements where you will find the people knowledgeable in the video process for burning that DVD with menus at
    http://forums.adobe.com/community/premiere_elements
    So  I recommend that you post your question at that Premiere Elements forum .

  • Why do I receive the exclamation point when I just change the album name? File goes missing?

    I keep all of my itunes media on an attached network hard drive.  Had no problems for months but over the past 45 days I've noticed that material has started to go missing that I know I did not delete.  I have found no malware on my system.
    I read a script to tell me all the files that had an exclamation point.  There were some TV shows (an entire season gone missing) and some CDs.
    I just did a test and imported a CD.  I then clicked "get info" and changed the name of the album.  Immediately I received the exclamation point and when I tried to find the original file it is gone.  I have no idea where the file has gone to.  I've tried searching, looking around to find it, and I can't. 
    Why is itunes having this behavior?  How is the file being deleted?  Any other thoughts or ideas of what I should do to stop this?
    I've also sent a support request to the hard drive mfg (lacie) but I'm not sure I'll get much help there.
    Thanks.

    More info:  I just ran the same test two ways.  One, I had some files on my desktop, run a script to move these files to the "automatically add to itunes" folder, the files move just fine to my external hard drive and to itunes.  The file plays just fine and the "get info" tab shows it is playing the file from the external hard drive where the file was moved to (not copied).  But, as soon as I change the artist name or the album, the file goes missing and I get the exclamation point.
    I ran the same test by putting the files on my desktop, but instead of moving the file to the "automatically add to itunes folder" I just double clicked the file to play it.  I let itunes add a copy and organize my folders.  This time, the file would have been copied (not physically moved) and I see itunes is playing the new copied version.  This time, when I try to change the artist name or album, I have no problems.
    I've never encountered this before.  Any info?  Thanks.

  • Read in the last line of a file

    Can I use the "Read from File " vi to read ionly the last line of the file? If so, how? Thanks in advance for the help
    [email protected]

    Reading the "last line" of a file implies that you are dealing with an humanly readable ASCII text file and there are special characters (/n or /r or a combination of the two) that signify line breaks.
    You can only start reading from a certain byte offset using file I/O. Unless all your lines are equal lenght, It is impossible to find the start of the last line without reading every character leading up to it in one way or another.
    So in the most general case, you would need to read the entire file and find the last linefeed.
    HOWEVER: Typically, lines are not infinitely long, so if you have an upper estimate of line lenght, you can read a slightly longer tail from the end of the file and find the last linefeed there. You can probably modify the VI I posted here for your purpose, just use an appropriate length. Message Edited by altenbach on 06-08-2005 10:42 AM
    LabVIEW Champion . Do more with less code and in less time .

  • The theme/background (AWESOME futuristic space scene) shown in the last part of "Getting Started video available for download?

    In the last part of the video "Getting Started" right after I downloaded Firefox 4, there was a background scene of an awesome page that showed some futuristic space scene that has the mozilla theme (fox) in the picture. I would like to know if it is available for download and/or it's name. I searched through the themes, but they don't show enough of the theme to actually see what the background would be once downloaded. Thank you in advance for any help you can offer.
    Gina Taylor

    Maybe you like this video as well:
    * http://vocamus.net/dave/?p=1233 Flight of the Navigator
    * http://videos.mozilla.org/serv/mozhacks/flight-of-the-navigator/
    * http://blog.vlad1.com/2010/12/21/webgl-in-firefox-4-beta-8/

  • How can I set the last mod of a file

    I get the last mod of a file (advanced file I/O palette -> File/Directory info)
    My problem is, that I download some files from a FTP-Server and the last mod of the downloaded file is not the same as on the ftp-server (the local file has always the time stamp from the downloaded date/time).
    I can list the timestamp from the files on the ftp-server, now I wanna change the last mod from my local file in the same as on the ftp-server.
    How can I make this?
    Thanks
    Regards
    Thomas
    Solved!
    Go to Solution.

    Hello TheDharmaInitiative,
    The "last modified" Attribute of a file can be altered programmatically using Windows API Functions.
    For LabVIEW i found a Post in a external Forum with some Sourcecode attached:
    http://www.labviewforum.de/index.php?s=c221d30094bfb9bd1edf87094f851b7f&showtopic=5895&st=0&p=28501&...
    For VB a Sourcecode Example can be found here:
    http://www.vbmonster.com/Uwe/Forum.aspx/vb/31547/Setting-a-file-s-timestamp
    To change the "last modified" Attribute manually a lot of Freeware and Open Source Tools are available:
    http://www.codeproject.com/KB/files/timestamp.aspx
    Regards
    Moritz M.

  • Z Tcode doesn't write the last part of program

    Hi experts,
    I have a program in a transaction code, and the last part, must be write:
    Send it to the world
        lv_sent_to_all = lo_send_request->send( i_with_error_screen = 'X' ).
        IF lv_sent_to_all = 'X'.
          WRITE 'Email Sent Successfully'.
        ENDIF.
        COMMIT WORK.
      CATCH cx_document_bcs INTO bcs_exception.
        WRITE: 'Error Occurred'. WRITE: 'Error Type', bcs_exception->error_type.
        EXIT.
    ENDTRY.
    If I execute only the program, the write works correctly.
    But if I execute the tcode (X) with the program, no write is working.
    Someone knows about it??? Why is working if you execute the program and not when you execute the transaction??
    thanks you very much!

    Its simple. While creating transaction code in SE93, u might have selected radio buton Program and screen (dialog transaction)
    It should be 2nd option Program and selection screen (report transaction)
    Create another transaction code selecting radio buton Program and selection screen (report transaction) and run the transaction code. It will work

  • HT201272 What about audio books?  my audio book didnt download the full book.  a file is missing.  how do I see that to download?

    What about audio books?  my audio book didnt download the full book.  a file is missing.  how do I see that to download?

    Audiobooks are currently a one-time only download. If it didn't download correctly 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 that audiobook and use the 'Report a Problem' link.

  • Storing the last modified date for files in a HashMap

    This method gets a list of all the .java files in the source subdirectory, gets the last modified date for them and stores the file name and last modified date in a HashMap.
    import java.util.HashMap;
    import java.io.FilenameFilter;
    import java.io.File;
    import java.util.ArrayList;
    public class myClass
         public static void main(String[] args)
              HashMap result = getLastModified();
         static FilenameFilter javaFilter = new FilenameFilter()
            public boolean accept(File dir, String name)
                return name.endsWith(".java");
         public HashMap getLastModified()
              HashMap lastModified = new HashMap();
              ArrayList javaFiles = new ArrayList();
              File sourceDir = new File(".\\Source");
              File currentFile;
              long lLastModified;
              //get a list of all the .java files in the source directory
              javaFiles=listFiles(javaFilter);
              //for all .java files get and store the last modified date
              for(int i=0; i<javaFiles.size(); i++)
                   currentFile=(File)javaFiles.get(i);
                   lLastModified=currentFile.lastModified();
                   lastModified.put(currentFile, lLastModified);
              return lastModified;
    }The problems I am getting are:
    >
    The method listFiles(FilenameFilter) is undefined for the type myClass
    and
    >
    The method put(Object, Object) in the type HashMap is not applicable for the arguments (File, long)
    can anyone help? What's the best way to go aobut this?

    Thanks for the replies abenstex I modified it so that javaFiles is now a File[] and made the change you suggested but I still have the second problem, here's the code so far:
    import java.util.HashMap;
    import java.io.FilenameFilter;
    import java.io.File;
    import java.util.ArrayList;
    public class myClass
         public static void main(String[] args)
              HashMap result = getLastModified();
         static FilenameFilter javaFilter = new FilenameFilter()
            public boolean accept(File dir, String name)
                return name.endsWith(".java");
         public HashMap getLastModified()
              HashMap lastModified = new HashMap();
              File[] javaFiles = {};
              File sourceDir = new File(".\\Source");
              File currentFile;
              long lLastModified;
              //get a list of all the .java files in the source directory
              javaFiles=sourceDir.listFiles(javaFilter);
              //for all .java files get and store the last modified date
              for(int i=0; i<javaFiles.length; i++)
                   currentFile=(File)javaFiles;
                   lLastModified=currentFile.lastModified();
                   lastModified.put(currentFile, lLastModified);
              return lastModified;

  • CS6 Keeps crashing on the last part of the render

    I get four windows to popup at the very end of any render. These two and another two telling me that this is the last chance to save my work. I have no idea what is wrong. I have tried reinstalling and obviously restarting. I have fine specs for running AE since I have used AE successfully in the past on this computer. I've turned multiprocessing and disk cache on and off. Please help.
    EDIT: Not sure if this is helpful at all but when I attempted to render again I got this as the "Last logged message": http://i.imgur.com/NAnG6.png

    W7 Ult x64, AMD Phenom X6 3.3GHz, 16gigs of RAM, GTX 550 Ti
    I'm rendering WMVs. I am not running out of disk space. I have tired various clips to render with (I'm assuming source files are the files I edit to render). What are comp settings?
    My settings have worked in the past, but not after my most recent format. Settings: http://imgur.com/a/0yDsF

  • Read to get the last line from a File

    Hi
    I am sending in a clarification , hoping that I get an efficient solution from the group, should somebody have come across this scenario and implemented.
    How to read or get the last line from a text file , which usually have a no of records, without actually reading or looping through all the lines
    I know there is some solution with the RandomAccessFile, but given there can be some encoding issues or so.
    Please let me know if somebody have implemented the same.
    Thanks n advance

    The character encoding could, indeed, be an issue especially with UTF-8. I think what I'd do is to create a byte array with the encoded, expected end of line sequence in it and work on the file in bytes. For example, seek to the last 100 bytes of the file, read those bytes and look for an EOL sequence backwards. If not found read the previous 100, 200, 400 bytes etc. until you do find an end of line. Then seek to after the EOL and read normally. Remember an EOL sequence might cross a boundary.
    UTF-8 would be a problem, especially with a unix format file because you might mistake part of a multi-byte sequence for '\n'. To be reliable on UTF-8 you'd need to go back three characters looking for sequence start markers (has the previous character got the top bit set, or the one before that the first two bits set, or the one before that the top three bits). Or you could just react to an encoding exception and try another position.

Maybe you are looking for

  • MBP won't offer 1920x1080 60Hz when the display is perfectly capable?

    I am trying to connect my 2010 MBP (10.6.8) to a Toshiba 39" LED HDTV (39L22U) through miniHDMI. I am extending the display, not mirroring it, and want a 1920x1080 60Hz resolution, but that is not an option on the list. "1080p (Television)" is one of

  • Best (PAL) workflow to convert HDV interlaced to DV progressive?

    Question - What is the best (PAL) workflow to convert HDV interlaced to DV progressive? Software: Pr, En and Ae - all CS4. My Camera: (Sony Z1) shoots HDV 1080i. When capturing and editing, I keep everything HDV and interlaced. Premiere Pro: Capture

  • Unrecognized ipod mini

    I've recently had some major issues with my ipod mini which I bought last summer. When I plug it into my USB cable cord into my computer windows has a message that pops up that says that the device has malfunctioned and that it is not recognized. I t

  • Java API for images retriveal, Create and update in New Java API for SP05 ?

    Hello Everyone,     Does any one know Which Java API Can be used to Display an Image in main table & API to add an image to Image table and link to Main Table in new release of Java API for MDM SP05. Really Appreciate all help. Thanks Vinita

  • G5 PPC, OS 10.4.11 The primary volume on main internal HD will not mount.

    The only other volume on the disk does mount, and when starting from this second volumes, the primary volume does mount..  From other startup volumes on my second internal HD, the volume does mount.  Disc utility repair, TechToolPro, and DiskWarrior