Another help thread involving strings and jtextarea

i have recently created a program, i have string message (which is made up of other strings created in my program) which i want to pass to a jtextarea box creating a list dont have a clue how to do so i tried using an arraylist but when i implemented it all it did was change the jtextarea output instead of creating a list. on top of this i have tried fixing it myself but only made the situation worse by deleting the way which i outputted the code, i have tried google but cant find an answer, any advice on my problem would be greatly appreciated
if(e.getSource()==confirmation) {
   String message = "Your order of" + " " + mainDish+ " "+ "with"+ " "+ ingredients+ " "+ "costs" + " "+ pounds.format(bill);
   output.setText(message);
  if(e.getSource()==confirmationList) {
    ArrayList list = new ArrayList();
    list.add(output.getText()); 
    output.setText(" ");

dbomb101 wrote:
i have recently created a program, i have string message (which is made up of other strings created in my program) which i want to pass to a jtextarea box creating a list dont have a clue how to do so i tried using an arraylist but when i implemented it all it did was change the jtextarea output instead of creating a list. on top of this i have tried fixing it myself but only made the situation worse by deleting the way which i outputted the code, i have tried google but cant find an answer, any advice on my problem would be greatly appreciated
if(e.getSource()==confirmation) {
String message = "Your order of" + " " + mainDish+ " "+ "with"+ " "+ ingredients+ " "+ "costs" + " "+ pounds.format(bill);
output.setText(message);
if(e.getSource()==confirmationList) {
ArrayList list = new ArrayList();
list.add(output.getText()); 
output.setText(" ");
The biggest problem I see with your code is that you create a new ArrayList every time through your code segment. This will absolutely garentee that you only have at most 1 entry in your ArrayList.
When you come into your code segment you create a new ArrayList
When you go out of Scope, you loose the ArrayList
So do you see a cyclic problem here?
If you want your ArrayList to contain an accumulation of your output, then you have to make your ArrayList a class variable.

Similar Messages

  • Help with String/ and or Array loading and comparing

    Hi all,
    I'm having some problems with trying to find the best way to achieve the following on a Poker Dealing program. I randomly shuffle a 52 card deck of playing cards and deal out 5 cards. Cool...
    Now I have to go back thru the String and determine if my hand of cards contains
    a pair
    2 pair
    3 of a kind
    Full House
    etc etc
    I am trying to do String comparisons (there is an empty compareCards method in my code right now, but I'm getting a bit frustrated as to find the best way to do it... Would an array load in a separate method be a better way???? What I need to do is after I load my hand , is to display a message stating a pair, 3 of a kind , etc etc.....
    Thanks in advance
    Mike
    Here is my code (please don't laugh too hard - I'm an old COBOL/Oracle guy):
    // Card shuffling and dealing program
    // Java core packages
    import java.awt.*;
    import java.awt.event.*;
    // Java extension packages
    import javax.swing.*;
    public class DeckOfCards extends JFrame {
    private Card deck[];
    private Card hand[];
    private int currentCard;
    private JButton dealButton, shuffleButton;
    private JTextArea outputArea ;
    private JTextField displayField;
    private JLabel statusLabel;
    // set up deck of cards and GUI
    public DeckOfCards()
    super( "Poker Game" );
    String faces[] = { "A", "2", "3", "4", "5", "6", "7", "8", "9", "10", "J", "Q", "K" };
    String suits[] = { "Hearts", "Diamonds", "Clubs", "Spades" };
    String display = "" ;
    deck = new Card[ 52 ];
    currentCard = -1;
    // populate deck with Card objects
    for ( int count = 0; count < deck.length; count++ )
    deck[ count ] = new Card( faces[ count % 13 ],
    suits[ count / 13 ] );
    // set up GUI and event handling
    Container container = getContentPane();
    container.setLayout( new FlowLayout() );
    // shuffle button
    shuffleButton = new JButton( "Shuffle cards" );
    shuffleButton.addActionListener(
    // anonymous inner class
    new ActionListener() {
    // shuffle deck
    public void actionPerformed( ActionEvent actionEvent )
    displayField.setText( "" );
    shuffle();
    displayField.setText( "The Deck is Shuffled" );
    statusLabel.setText( "" );
    } // end anonymous inner class
    ); // end call to addActionListener
    container.add( shuffleButton );
    // Deal button
    dealButton = new JButton( "Deal Hand" );
    dealButton.addActionListener (
    // anonymous inner class
    new ActionListener() {
    // deal 5 cards
    public void actionPerformed( ActionEvent actionEvent )
    outputArea.setText( "" ) ;
    displayField.setText( "" );
    for ( int cctr = 1 ; cctr <= 5; cctr++ ){     
    Card dealt = dealCard();
    if ( dealt != null ) {
    outputArea.append( dealt.toString()+"\n" );
    else {
    displayField.setText( "No more cards left" );
    statusLabel.setText( "Shuffle cards to continue" );}
    } // end for structure
    compareCards() ;
    } // end action
    } // end anonymous inner class
    ); // end call to addActionListener
    container.add( dealButton );
    outputArea = new JTextArea (10, 20) ;
    outputArea.setEditable( false ) ;
    container.add( outputArea ) ;
    displayField = new JTextField( 20 );
    displayField.setEditable( false );
    container.add( displayField );
    statusLabel = new JLabel();
    container.add( statusLabel );
    setSize( 275, 275 ); // set window size
    show(); // show window
    // shuffle deck of cards with one-pass algorithm
    public void shuffle()
    currentCard = -1;
    // for each card, pick another random card and swap them
    for ( int first = 0; first < deck.length; first++ ) {
    int second = ( int ) ( Math.random() * 52 );
    Card temp = deck[ first ];
    deck[ first ] = deck[ second ];
    deck[ second ] = temp;
    dealButton.setEnabled( true );
    public void compareCards()
    public Card dealCard()
    if ( ++currentCard < deck.length )
    return deck[ currentCard ];
    else {       
    dealButton.setEnabled( false );
    return null;
    // execute application
    public static void main( String args[] )
    DeckOfCards app = new DeckOfCards();
    app.addWindowListener(
    // anonymous inner class
    new WindowAdapter() {
    // terminate application when user closes window
    public void windowClosing( WindowEvent windowEvent )
    System.exit( 0 );
    } // end anonymous inner class
    ); // end call to addWindowListener
    } // end method main
    } // end class DeckOfCards
    // class to represent a card
    class Card {
    private String face;
    private String suit;
    // constructor to initialize a card
    public Card( String cardFace, String cardSuit )
    face = cardFace;
    suit = cardSuit;
    // return String represenation of Card
    public String toString()
    return face + " of " + suit;
    } // end class Card

    You could have the original face values as integers, thus Ace = 1, Jack = 11 (it'll be easy enough to display the proper values AJQK if you keep your string array and just display whatever corresponds to the value held in your int array).
    Each player gets an array of five cards. You could the loop through each hand and increment values held in another array by one according to the value of the card. Haven't coded the following up but it should work I think.
    // hand [ ] represents the cards held by that player
    int handChecker [ ] = new int [14]
    for (int counter = 0; counter < 5; ++ counter)
    // 1st card is an Ace. handChecker [1] will be incrementd by one and so on
    // 2nd card is a 9. handChecker[9] will be incremented by one.
    handChecker[hand[counter]] += 1;
    // Loop through the array handChecker to find pairs etc.
    boolean pair = false;
    bollean tofk = false;
    for (int counter = 1; counter < 14; ++ counter)
    if (handChecker[counter] == 2)
    pair = true;
    if (handChecker[counter] == 3)
    tofk = true;
    if (pair)
    // player has a pair
    if(tofk)
    // player has three of a kind
    if(pair && tofk)
    // player has a full house

  • I have a seagate 1tb hard drive and a 16gb memory stick, how do i transfer avi files from one to another as the click drag and drop wont work, please help?

    i have a seagate 1tb hard drive and a 16gb memory stick, how do i transfer avi files from one to another as the click drag and drop wont work, please help?

    Greetings,
    What happens when you drag it?
    Make sure the drive you are moving the files to has enough available space to receive the file:
    Click on the movie file and go to File >  Get Info and note the "size"
    Check the drive to which you are moving the file to make sure it has enough available space: https://idisk.me.com/madisonfile-Public/web/finder-drive-available-space-and-for mat.html
    Also note the format of the drive you are copying too.  If it is not Mac OS Extended or FAT (not recommended unless you are taking it to a windows computer) then that may be the issue.
    Hope that helps.

  • I am trying to edit a project originally started on another computer, by someone else and saved onto an external h-drive, but keep getting 'general error 48' when I try to render it to work further. Can anyone help?

    I am trying to edit a project originally started on another computer, by someone else and saved onto an external h-drive, but keep getting 'general error 48' when I try to render it to work further. Can anyone help?

    Is this problem only occurring with the project you copied from an external drive, or with any FCP project?
    For example, if you were to create a new project, do you still have this problem?
    In FCP, if you go to the menu FInal Cut Pro > System Settings and look at the Scratch Disks Tab, is it set where you expect it to be? Have you tried switching the scratch disk to a different disk?
    MtD

  • Worker Thread and Helper Thread for Gauge updates

    Hi
    I know that in the Smart Ticket sample application there is an example with the implematation of "Each worker thread also has a helper thread that displays an animated gauge to indicate the progress of the worker thread".
    But i can't find the sample on java.sun.com anymore..:-(. Do you have the source code of smart ticket or even an example of the helper thread implemetation. The worker thread i have already implementated.
    Thanx
    Michael

    Here's a simple outline of what I do. This has been drastically stipped down from my actual code as I use teh message for all kinds of things incluing requests on a queue to the worker and resposes back. So in the real code I also have a success flag, a command type, an argument object and a result object with get and set methods for all of them.
    1) define an interface that the GUI code can implement and pass a reference to the worker which stores it in myTarget.
    interface MessageTarget
         void postMessage(Message m);
         void runMessage(Message m);
    }2) define a message class
    class Message implements Runnable
         Object data;
         MessageTarget target;
         Message(MessageTarget target, Object data)
              this.target = target;
              this.data = data;
         public void run(){target.runMessage(this);}
         public Object getData(){return data;}
         public void postMessage(){target.postMessage(this);}
    }3) implement the MessageTarget interface in the GUI
    // put a response from the database onto the swing queue
    public void postMessage(Message r)
         javax.swing.SwingUtilities.invokeLater((Runnable)r);
    // process messages
    public void runMessage(Message m)
         Object data = m.getData();
    }4) post messages back from the worker
           new Message(myTarget,myData).post();

  • Little help with EL: concat static string and databound number

    Hi OTN,
    I'm a bit stuck with a simple - as I thought - case: concatenating static string and databound number in EL:
    I have a deffered expression like:
    #{1 != 2 ? ('Number is ' bindings.SomeNumber.inputValue) : 'no number'}
    1 and 2 are databound values too but the question is about showing "Number is 5" where 5 is a SomeNumber.
    Expression editor shows error on 'Number is'. And the error dissapperars if I remove "bindings.SomeNumber.inputValue".
    How can I concatenate them?
    Thanks.

    Another option for you is to write that formatting logic in a static utility classes that takes parameters to return strings.
    Ex.:
    */WEB-INF/utils.tld:*
    <taglib xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-jsptaglibrary_2_1.xsd" version="2.1" xmlns="http://java.sun.com/xml/ns/javaee">
      <description>utils</description>
      <display-name>utils</display-name>
      <tlib-version>1.0</tlib-version>
      <short-name>utils</short-name>
      <uri>http://biz.com/utils</uri>
      <function>
         <name>getFormattedNumber</name>
         <function-class>com.mybiz.FormatUtils</function-class>
         <function-signature>java.lang.String getFormattedNumber(oracle.jbo.domain.Number)</function-signature>
      </function>
    </taglib>And then you use them in your EL expression like this:
    page.jspx:_
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1" xmlns:f="http://java.sun.com/jsf/core"
              xmlns:af="http://xmlns.oracle.com/adf/faces/rich"
              xmlns:utils="http://biz.com/utils">
      <af:outputText value="#{utils:getFormattedNumber(bindings.Number.inputValue)}"/>
    </jsp:root>Better to have many options isn't it?

  • Field Symbols, Field String, and Field Group.

    Hi,
    Can you differentiate between filed symbols, field strings and field groups,
    With regards,
    Bharath Mohan B

    Hi,
    Field Symbols
    Field symbols are placeholders or symbolic names for other fields. They do not physically reserve space for a field, but point to its contents. A field symbol cam point to any data object. The data object to which a field symbol points is assigned to it after it has been declared in the program.
    Whenever you address a field symbol in a program, you are addressing the field that is assigned to the field symbol. After successful assignment, there is no difference in ABAP whether you reference the field symbol or the field itself. You must assign a field to each field symbol before you can address the latter in programs.
    Field symbols are similar to dereferenced pointers in C (that is, pointers to which the content operator * is applied). However, the only real equivalent of pointers in ABAP, that is, variables that contain a memory address (reference) and that can be used without the contents operator, are reference variables in ABAP Objects.
    All operations programmed with field symbols are applied to the field assigned to it. For example, a MOVE statement between two field symbols moves the contents of the field assigned to the first field symbol to the field assigned to the second field symbol. The field symbols themselves point to the same fields after the MOVE statement as they did before.
    You can create field symbols either without or with type specifications. If you do not specify a type, the field symbol inherits all of the technical attributes of the field assigned to it. If you do specify a type, the system checks the compatibility of the field symbol and the field you are assigning to it during the ASSIGN statement.
    Field symbols provide greater flexibility when you address data objects:
    If you want to process sections of fields, you can specify the offset and length of the field dynamically.
    You can assign one field symbol to another, which allows you to address parts of fields.
    Assignments to field symbols may extend beyond field boundaries. This allows you to address regular sequences of fields in memory efficiently.
    You can also force a field symbol to take different technical attributes from those of the field assigned to it.
    The flexibility of field symbols provides elegant solutions to certain problems. On the other hand, it does mean that errors can easily occur. Since fields are not assigned to field symbols until runtime, the effectiveness of syntax and security checks is very limited for operations involving field symbols. This can lead to runtime errors or incorrect data assignments.
    While runtime errors indicate an obvious problem, incorrect data assignments are dangerous because they can be very difficult to detect. For this reason, you should only use field symbols if you cannot achieve the same result using other ABAP statements.
    For example, you may want to process part of a string where the offset and length depend on the contents of the field. You could use field symbols in this case. However, since the MOVE statement also supports variable offset and length specifications, you should use it instead. The MOVE statement (with your own auxiliary variables if required) is much safer than using field symbols, since it cannot address memory beyond the boundary of a field. However, field symbols may improve performance in some cases.
    check the below links u will get the answers for your questions
    http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb3860358411d1829f0000e829fbfe/content.htm
    http://www.sts.tu-harburg.de/teaching/sap_r3/ABAP4/field_sy.htm
    http://searchsap.techtarget.com/tip/1,289483,sid21_gci920484,00.html
    Syntax Diagram
    FIELD-SYMBOLS
    Basic form
    FIELD-SYMBOLS <fs>.
    Extras:
    1. ... TYPE type
    2. ... TYPE REF TO cif
    3. ... TYPE REF TO DATA
    4. ... TYPE LINE OF type
    5. ... LIKE s
    6. ... LIKE LINE OF s
    7. ... TYPE tabkind
    8. ... STRUCTURE s DEFAULT wa
    The syntax check performed in an ABAP Objects context is stricter than in other ABAP areas. See Cannot Use Untyped Field Symbols ad Cannot Use Field Symbols as Components of Classes.
    Effect
    This statement declares a symbolic field called <fs>. At runtime, you can assign a concrete field to the field symbol using ASSIGN. All operations performed with the field symbol then directly affect the field assigned to it.
    You can only use one of the additions.
    Example
    Output aircraft type from the table SFLIGHT using a field symbol:
    FIELD-SYMBOLS <PT> TYPE ANY.
    DATA SFLIGHT_WA TYPE SFLIGHT.
    ASSIGN SFLIGHT_WA-PLANETYPE TO <PT>.
    WRITE <PT>.
    Addition 1
    ... TYPE type
    Addition 2
    ... TYPE REF TO cif
    Addition 3
    ... TYPE REF TO DATA
    Addition 4
    ... TYPE LINE OF type
    Addition 5
    ... LIKE s
    Addition 6
    ... LIKE LINE OF s
    Addition 7
    ... TYPE tabkind
    Effect
    You can define the type of the field symbol using additions 2 to 7 (just as you can for FORM parameters (compare Defining the Type of Subroutine Parameters). When you use the ASSIGN statement, the system carries out the same type checks as for USING parameters of FORMs.
    This addition is not allowed in an ABAP Objects context. See Cannot Use Obsolete Casting for FIELD SYMBOLS.
    In some cases, the syntax rules that apply to Unicode programs are different than those for non-Unicode programs. See Defining Types Using STRUCTURE.
    Effect
    Assigns any (internal) field string or structure to the field symbol from the ABAP Dictionary (s). All fields of the structure can be addressed by name: <fs>-fieldname. The structured field symbol points initially to the work area wa specified after DEFAULT.
    The work area wa must be at least as long as the structure s. If s contains fields of the type I or F, wa should have the structure s or at least begin in that way, since otherwise alignment problems may occur.
    Example
    Address components of the flight bookings table SBOOK using a field symbol:
    DATA SBOOK_WA LIKE SBOOK.
    FIELD-SYMBOLS <SB> STRUCTURE SBOOK
    DEFAULT SBOOK_WA.
    WRITE: <SB>-BOOKID, <SB>-FLDATE.
    Related
    ASSIGN, DATA
    Additional help
    Declaring Field Symbols
    FIELD GROUPS
    are used to hold/handle large amount of data when the internal table are not useful
    we use EXTRACT statement, HEADER structure in them
    see the example
    REPORT demo_extract.
    NODES: spfli, sflight.
    FIELD-GROUPS: header, flight_info, flight_date.
    START-OF-SELECTION.
      INSERT: spfli-carrid spfli-connid sflight-fldate
                INTO header,
              spfli-cityfrom spfli-cityto
                INTO flight_info.
    GET spfli.
      EXTRACT flight_info.
    GET sflight.
      EXTRACT flight_date.
    END-OF-SELECTION.
      SORT STABLE.
      LOOP.
        AT FIRST.
          WRITE / 'Flight list'.
          ULINE.
        ENDAT.
        AT flight_info WITH flight_date.
          WRITE: / spfli-carrid , spfli-connid, sflight-fldate,
                   spfli-cityfrom, spfli-cityto.
        ENDAT.
        AT flight_date.
          WRITE: / spfli-carrid , spfli-connid, sflight-fldate.
        ENDAT.
        AT LAST.
          ULINE.
          WRITE: cnt(spfli-carrid), 'Airlines'.
          ULINE.
        ENDAT.
      ENDLOOP.
    FIELD STRING is nothing but a string with  one row of records.
    Reward points if useful
    regards
    Anji

  • [HELP] Problem with restore and recovery to new host

    Hi, guys!
    I have been trying for two days, but still cannot get it to work.
    I have taken a full hot(online) backup with archive logs as well as the control file and SPFILE, and then copied the backup to the new host with the same directory structure and settings. Finally, I have tried to restore & recover the database on the new host but failed during the restore process.
    Both the original host and the new host have the same Oracle installed down to the patch level. I couldn't figure out the proper solution to this problem base on my limited knowledge about Oracle DB.
    Could anyone help me out here? Any advice would be appreciated!
    RMAN> restore database until sequence 10 thread 1;
    Starting restore at 08-NOV-11
    using channel ORA_DISK_1
    channel ORA_DISK_1: starting datafile backupset restore
    channel ORA_DISK_1: specifying datafile(s) to restore from backup set
    restoring datafile 00001 to D:\DBDATA\PRODDB\SYSTEM01.DBF
    restoring datafile 00002 to D:\DBDATA\PRODDB\UNDOTBS01.DBF
    restoring datafile 00003 to D:\DBDATA\PRODDB\SYSAUX01.DBF
    restoring datafile 00004 to D:\DBDATA\PRODDB\USERS01.DBF
    restoring datafile 00005 to D:\ORA_DATADATA01.DBF
    restoring datafile 00006 to D:\ORA_DATA\DATA02.DBF
    restoring datafile 00007 to D:\ORA_DATA\INDX01.DBF
    restoring datafile 00008 to D:\ORA_DATA\INDX02.DBF
    channel ORA_DISK_1: reading from backup piece C:\ORACLE\PRODUCT\10.2.0\FLASH_REC
    OVERY_AREA\PRODDB\BACKUPSET\2011_11_07\O1_MF_NNNDF_TAG20111107T175037_7CH6YYVJ_.BK
    P
    failover to previous backup
    RMAN-00571: ===========================================================
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ===========================================================
    RMAN-03002: failure of restore command at 11/08/2011 11:41:33
    RMAN-06026: some targets not found - aborting restore
    RMAN-06023: no backup or copy of datafile 4 found to restore
    RMAN-06023: no backup or copy of datafile 3 found to restore
    RMAN-06023: no backup or copy of datafile 2 found to restore
    RMAN-06023: no backup or copy of datafile 1 found to restore
    Here is some extra information that you might want to know about:
    RMAN> list incarnation;
    List of Database Incarnations
    DB Key Inc Key DB Name DB ID STATUS Reset SCN Reset Time
    1 1 PRODDB 3774691295 PARENT 1 17-APR-07
    2 2 PRODDB 3774691295 PARENT 521803 06-OCT-11
    3 3 PRODDB 3774691295 PARENT 1595143 20-OCT-11
    4 4 PRODDB 3774691295 PARENT 1600974 20-OCT-11
    5 5 PRODDB 3774691295 PARENT 1952053 27-OCT-11
    6 6 PRODDB 3774691295 CURRENT 2146951 07-NOV-11
    RMAN> list backup recoverable;
    List of Backup Sets
    ===================
    BS Key Type LV Size Device Type Elapsed Time Completion Time
    37 Full 822.34M DISK 00:29:47 07-NOV-11
    BP Key: 37 Status: AVAILABLE Compressed: NO Tag: TAG20111107T175037
    Piece Name: C:\ORACLE\PRODUCT\10.2.0\FLASH_RECOVERY_AREA\PRODDB\BACKUPSET\
    2011_11_07\O1_MF_NNNDF_TAG20111107T175037_7CH6YYVJ_.BKP
    List of Datafiles in backup set 37
    File LV Type Ckp SCN Ckp Time Name
    1 Full 2149673 07-NOV-11 D:\DBDATA\PRODDB\SYSTEM01.DBF
    2 Full 2149673 07-NOV-11 D:\DBDATA\PRODDB\UNDOTBS01.DBF
    3 Full 2149673 07-NOV-11 D:\DBDATA\PRODDB\SYSAUX01.DBF
    4 Full 2149673 07-NOV-11 D:\DBDATA\PRODDB\USERS01.DBF
    5 Full 2149673 07-NOV-11 D:\ORA_DATA\DATA01.DBF
    6 Full 2149673 07-NOV-11 D:\ORA_DATA\DATA02.DBF
    7 Full 2149673 07-NOV-11 D:\ORA_DATA\INDX01.DBF
    8 Full 2149673 07-NOV-11 D:\ORA_DATA\INDX02.DBF
    BS Key Type LV Size Device Type Elapsed Time Completion Time
    38 Full 6.95M DISK 00:00:03 07-NOV-11
    BP Key: 38 Status: AVAILABLE Compressed: NO Tag: TAG20111107T182034
    Piece Name: C:\ORACLE\PRODUCT\10.2.0\FLASH_RECOVERY_AREA\PRODDB\AUTOBACKUP
    \2011_11_07\O1_MF_S_766606834_7CH8Q439_.BKP
    Control File Included: Ckp SCN: 2151141 Ckp time: 07-NOV-11
    SPFILE Included: Modification time: 07-NOV-11
    BS Key Size Device Type Elapsed Time Completion Time
    39 18.46M DISK 00:00:05 08-NOV-11
    BP Key: 39 Status: AVAILABLE Compressed: NO Tag: TAG20111108T093359
    Piece Name: C:\ORACLE\PRODUCT\10.2.0\FLASH_RECOVERY_AREA\PRODDB\BACKUPSET\
    2011_11_08\O1_MF_ANNNN_TAG20111108T093359_7CJY7TG1_.BKP
    List of Archived Logs in backup set 39
    Thrd Seq Low SCN Low Time Next SCN Next Time
    1 1 2146951 07-NOV-11 2149493 07-NOV-11
    1 2 2149493 07-NOV-11 2149519 07-NOV-11
    1 3 2149519 07-NOV-11 2149565 07-NOV-11
    1 4 2149565 07-NOV-11 2149641 07-NOV-11
    1 5 2149641 07-NOV-11 2172859 07-NOV-11
    1 6 2172859 07-NOV-11 2197851 07-NOV-11
    1 7 2197851 07-NOV-11 2220349 08-NOV-11
    1 8 2220349 08-NOV-11 2222621 08-NOV-11
    1 9 2222621 08-NOV-11 2222729 08-NOV-11
    1 10 2222729 08-NOV-11 2223088 08-NOV-11
    BS Key Type LV Size Device Type Elapsed Time Completion Time
    40 Full 6.95M DISK 00:00:00 08-NOV-11
    BP Key: 40 Status: AVAILABLE Compressed: NO Tag: TAG20111108T093411
    Piece Name: C:\ORACLE\PRODUCT\10.2.0\FLASH_RECOVERY_AREA\PRODDB\AUTOBACKUP
    \2011_11_08\O1_MF_S_766661651_7CJY84LK_.BKP
    Control File Included: Ckp SCN: 2223097 Ckp time: 08-NOV-11
    SPFILE Included: Modification time: 08-NOV-11
    Thanks in advance!
    Jay

    Thank you for your reply,Hemant K Chitale!
    >
    a) Does the directory structur exist on the new server :
    D:\DBDATA\PRODDB\ --- for files 1 to 4
    D:\ --- for file 5
    D:\ORA_DATA\ --- for files 6 to 8
    >
    Yep, I have doubled check the directory structure that get in the way, and they are all exist.
    Would it be something to do with the folder permissions?
    >
    b) Apparently a RESETLOGS has been issued on 07-Nov. Which controflile backup do you have restored and mounted on the new server ? It should be the one after the RESETLOGS.
    >
    I restored the one included with the backup. Should I take another backup of controlfile seperately and restore from it instead?
    >
    (I assume that you did a RESTORE CONTROLFILE followed by sql "alter database mount" before the attempt to RESTORE DATABASE)
    >
    Yep, that's exactly what I did.
    //executed @ RMAN prompt of the new host
    startup nomount; 'the new host has the right SPFILE to start with so i didn''t bother to RESTORE SPFILE first.
    restore controlfile from autobackup;
    alter database mount;
    restore  database sequence 10 thread 1;
    //get stucked here with RMAN-06026, 06023
    //...the following is not executed yet.... :-(
    recover database until sequence 10;
    alter database open resetlogs;Edited by: HappyJay on 2011/11/08 13:25
    I have made several attemps with your advice, but still get the same type of errors.
    Here is the output:
    RMAN> list backup of controlfile;
    List of Backup Sets
    ===================
    BS Key Type LV Size Device Type Elapsed Time Completion Time
    38 Full 6.95M DISK 00:00:03 07-NOV-11
    BP Key: 38 Status: AVAILABLE Compressed: NO Tag: TAG20111107T182034
    Piece Name: C:\ORACLE\PRODUCT\10.2.0\FLASH_RECOVERY_AREA\PRODDB\AUTOBACKUP
    \2011_11_07\O1_MF_S_766606834_7CH8Q439_.BKP
    Control File Included: Ckp SCN: 2151141 Ckp time: 07-NOV-11
    BS Key Type LV Size Device Type Elapsed Time Completion Time
    40 Full 6.95M DISK 00:00:00 08-NOV-11
    BP Key: 40 Status: AVAILABLE Compressed: NO Tag: TAG20111108T093411
    Piece Name: C:\ORACLE\PRODUCT\10.2.0\FLASH_RECOVERY_AREA\PRODDB\AUTOBACKUP
    +\2011_11_08\O1_MF_S_766661651_7CJY84LK_.BKP+
    Control File Included: Ckp SCN: 2223097      Ckp time: 08-NOV-11
    as you suggested, this backup piece of controlfile should be right one to be restored.
    RMAN> shutdown;
    database dismounted
    Oracle instance shut down
    RMAN> startup nomount;
    connected to target database (not started)
    Oracle instance started
    Total System Global Area 490733568 bytes
    Fixed Size 1291360 bytes
    Variable Size 364907424 bytes
    Database Buffers 121634816 bytes
    Redo Buffers 2899968 bytes
    RMAN> restore controlfile from autobackup;
    Starting restore at 08-NOV-11
    allocated channel: ORA_DISK_1
    channel ORA_DISK_1: sid=157 devtype=DISK
    recovery area destination: C:\oracle\product\10.2.0\flash_recovery_area
    database name (or database unique name) used for search: PRODDB
    channel ORA_DISK_1: autobackup found in the recovery area
    channel ORA_DISK_1: autobackup found: C:\ORACLE\PRODUCT\10.2.0\FLASH_RECOVERY_AR
    EA\PRODDB\AUTOBACKUP\2011_11_08\O1_MF_S_766661651_7CJY84LK_.BKP
    channel ORA_DISK_1: control file restore from autobackup complete
    output filename=D:\DBDATA\PRODDB\CONTROL01.CTL
    output filename=D:\DBDATA\PRODDB\CONTROL02.CTL
    output filename=D:\DBDATA\PRODDB\CONTROL03.CTL
    Finished restore at 08-NOV-11
    tried shutdown normally and mount again instead.
    RMAN> shutdown;
    Oracle instance shut down
    RMAN> exit
    Recovery Manager complete.
    C:\>rman target /
    Recovery Manager: Release 10.2.0.3.0 - Production on Tue Nov 8 13:49:42 2011
    Copyright (c) 1982, 2005, Oracle. All rights reserved.
    connected to target database (not started)
    RMAN> startup mount;
    Oracle instance started
    database mounted
    Total System Global Area 490733568 bytes
    Fixed Size 1291360 bytes
    Variable Size 369101728 bytes
    Database Buffers 117440512 bytes
    Redo Buffers 2899968 bytes
    RMAN> restore database until sequence 10 thread 1;
    Starting restore at 08-NOV-11
    Starting implicit crosscheck backup at 08-NOV-11
    using target database control file instead of recovery catalog
    allocated channel: ORA_DISK_1
    channel ORA_DISK_1: sid=156 devtype=DISK
    Crosschecked 3 objects
    Finished implicit crosscheck backup at 08-NOV-11
    Starting implicit crosscheck copy at 08-NOV-11
    using channel ORA_DISK_1
    Crosschecked 2 objects
    Finished implicit crosscheck copy at 08-NOV-11
    searching for all files in the recovery area
    cataloging files...
    cataloging done
    List of Cataloged Files
    =======================
    File Name: C:\ORACLE\PRODUCT\10.2.0\FLASH_RECOVERY_AREA\PRODDB\AUTOBACKUP\2011_11_
    08\O1_MF_S_766661651_7CJY84LK_.BKP
    using channel ORA_DISK_1
    channel ORA_DISK_1: starting datafile backupset restore
    channel ORA_DISK_1: specifying datafile(s) to restore from backup set
    restoring datafile 00001 to D:\DBDATA\PRODDB\SYSTEM01.DBF
    restoring datafile 00002 to D:\DBDATA\PRODDB\UNDOTBS01.DBF
    restoring datafile 00003 to D:\DBDATA\PRODDB\SYSAUX01.DBF
    restoring datafile 00004 to D:\DBDATA\PRODDB\USERS01.DBF
    restoring datafile 00005 to D:\ORA_DATA\DATA01.DBF
    restoring datafile 00006 to D:\ORA_DATA\DATA02.DBF
    restoring datafile 00007 to D:\ORA_DATA\INDX01.DBF
    restoring datafile 00008 to D:\ORA_DATA\INDX02.DBF
    channel ORA_DISK_1: reading from backup piece C:\ORACLE\PRODUCT\10.2.0\FLASH_REC
    OVERY_AREA\PRODDB\BACKUPSET\2011_11_07\O1_MF_NNNDF_TAG20111107T175037_7CH6YYVJ_.BK
    P
    failover to previous backup
    //however, still get the same results(ended up with errors)
    RMAN-00571: ===========================================================
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ===========================================================
    RMAN-03002: failure of restore command at 11/08/2011 13:50:29
    RMAN-06026: some targets not found - aborting restore
    RMAN-06023: no backup or copy of datafile 4 found to restore
    RMAN-06023: no backup or copy of datafile 3 found to restore
    RMAN-06023: no backup or copy of datafile 2 found to restore
    RMAN-06023: no backup or copy of datafile 1 found to restore
    Edited by: HappyJay on 2011/11/08 13:59

  • My iphone 4 will no longer connect to my Itunes since 7.1.1 update itunes has latest update as well followed help which involved using mobile device properties no good re installed itunes still same problem iphone is showing up on pc as connected

    my iphone 4 will no longer connect to my Itunes since 7.1.1 update, itunes has latest update as well followed help which involved using mobile device properties no good re installed itunes still same problem iphone is showing up on pc as connected but itunes unable to see it
    any Ideas cheers

    Try holding the power and home button untill the apple symbol appears and let it reboot, if that does not work Try a DFU restore https://discussions.apple.com/thread/5269891

  • Another problem with using canvases and scrollviewers in tab

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Windows;
    using System.Windows.Controls;
    using System.Windows.Data;
    using System.Windows.Documents;
    using System.Windows.Input;
    using System.Windows.Media;
    using System.Windows.Media.Imaging;
    using System.Windows.Navigation;
    using System.Windows.Shapes;
    namespace WPFDynamicTab
        /// <summary>
        /// Interaction logic for MainWindow.xaml
        /// </summary>
        public partial class MainWindow : Window
            private List<TabItem> _tabItems;
            private TabItem _tabAdd;
       //     private Canvas canvas1;
            public MainWindow()
               try
                    InitializeComponent();
                    // initialize tabItem array
                    _tabItems = new List<TabItem>();
                    // add a tabItem with + in header
                    _tabAdd = new TabItem();
                 //    canvas1= new Canvas();
                    _tabAdd.Header = "+";
                    _tabAdd.MouseLeftButtonUp += _tabAdd_MouseLeftButtonUp;
                    _tabItems.Add(_tabAdd);
                    this.AddTabItem();   // add first tab
                    // bind tab control
                    tabDynamic.DataContext = _tabItems;
                    tabDynamic.SelectedIndex = 0;
                catch (Exception ex)
                    MessageBox.Show(ex.Message);
            private TabItem AddTabItem()
                int count = _tabItems.Count;
                // create new tab item
                TabItem tab = new TabItem();
                tab.Header = string.Format("Tab {0}", count);
                tab.Name = string.Format("tab{0}", count);
                tab.HeaderTemplate = tabDynamic.FindResource("TabHeader") as DataTemplate;
                // add controls to tab item, this case I added just a canvas
                ScrollViewer scrollview1 = new ScrollViewer();
                Canvas canvas1 = new Canvas();
                canvas1.Name = "canvas1";
    // XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
                Canvas_Paint(ref canvas1); // Canvas_Paint defines the background color of  "canvas1"
                scrollview1.Height=200;
                scrollview1.VerticalAlignment = VerticalAlignment.Center;
                canvas1.Height=400+400*count;
                scrollview1.Content = canvas1;
                tab.Content = scrollview1;    
    //YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY 
                // insert tab item right before the last (+) tab item
                _tabItems.Insert(count - 1, tab);
                return tab;
            private void _tabAdd_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
                TabItem newTab = this.AddTabItem();
                // clear tab control binding
                tabDynamic.DataContext = null;
                // bind tab control
                tabDynamic.DataContext = _tabItems;
                tabDynamic.SelectedItem = newTab;
            private void Canvas_Paint(ref Canvas canvas1)
                int count = _tabItems.Count;
                switch (count)
                    case 0:
                        canvas1.Background = Brushes.Green;
                        break;
                    case 1:
                        canvas1.Background = Brushes.Red;
                        break;
                    case 2:
                        canvas1.Background = Brushes.Blue;
                        break;
                    case 3:
                        canvas1.Background = Brushes.Yellow;
                        break;
                    case 4:
                        canvas1.Background = Brushes.Brown;
                        break;
                    case 5:
                        canvas1.Background = Brushes.Orange;
                        break;
                    case 6:
                        canvas1.Background = Brushes.Olive;
                        break;
                    default:
                        break;
            private void tabDynamic_SelectionChanged(object sender, SelectionChangedEventArgs e)
          // this is a dummy method
     and the xaml
    <Window x:Class="WPFDynamicTab.MainWindow"
            xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
            xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
            Title="Dynamic Tab" Height="300" Width="527" WindowStartupLocation="CenterScreen">
        <Grid>
            <TabControl Name="tabDynamic" ItemsSource="{Binding}" SelectionChanged="tabDynamic_SelectionChanged">
                <TabControl.Resources>
                    <DataTemplate x:Key="TabHeader" DataType="TabItem">
                        <DockPanel>
                            <TextBlock Text="{Binding RelativeSource={RelativeSource AncestorType=TabItem }, Path=Header}" />
                        </DockPanel>
                    </DataTemplate>
                </TabControl.Resources>
            </TabControl>
        </Grid>
    </Window>
    The program does the job but there are 2 questions. I am using a scrollviewer and each time the tab increases the canvas size increases and this is reflected in the scrollview bar getting shorter.
    Question 1)
    I set the scrollview1 height to  200 ,which was obtained by trial and error, increasing causes the extents to go outside the box etc,
    the window height was 300 , is it possible to automatically set the scrollviewer height.
    Question 2)
    Is it possible to  put the canvas and scrollviewer into the XAML I tried but  failed
    Note: the relevent code to the above questeions is between XXXXX... and YYYY...

    >>the window height was 300 , is it possible to automatically set the scrollviewer height.
    You should not specify an explicit height if you want an element to fill the available space. Just set the VerticalAlignment property to Strecth (which is the default value for a ScrollViewer:
    Canvas_Paint(ref canvas1); // Canvas_Paint defines the background color of "canvas1"
    scrollview1.VerticalAlignment = VerticalAlignment.Stretch;
    canvas1.Height = 400 + 400 * count;
    scrollview1.Content = canvas1;
    tab.Content = scrollview1;
    //YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY
    // insert tab item right before the last (+) tab item
    _tabItems.Insert(count - 1, tab);
    return tab;
    >>Is it possible to  put the canvas and scrollviewer into the XAML I tried but  failed
    Well, you could define the ScrollViewer, i.e. the root element, as a resource and then add access it from the AddTabItem() method like this:
    <Window x:Class="WPFDynamicTab.MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="Dynamic Tab" Height="300" Width="527" WindowStartupLocation="CenterScreen">
    <Window.Resources>
    <ScrollViewer x:Key="sv" x:Shared="false">
    <Canvas Height="800">
    </Canvas>
    </ScrollViewer>
    </Window.Resources>
    <Grid>
    <TabControl Name="tabDynamic" ItemsSource="{Binding}" SelectionChanged="tabDynamic_SelectionChanged">
    <TabControl.Resources>
    <DataTemplate x:Key="TabHeader" DataType="TabItem">
    <DockPanel>
    <TextBlock Text="{Binding RelativeSource={RelativeSource AncestorType=TabItem }, Path=Header}" />
    </DockPanel>
    </DataTemplate>
    </TabControl.Resources>
    </TabControl>
    </Grid>
    </Window>
    private TabItem AddTabItem()
    int count = _tabItems.Count;
    // create new tab item
    TabItem tab = new TabItem();
    tab.Header = string.Format("Tab {0}", count);
    tab.Name = string.Format("tab{0}", count);
    tab.HeaderTemplate = tabDynamic.FindResource("TabHeader") as DataTemplate;
    // add controls to tab item, this case I added just a canvas
    ScrollViewer scrollview1 = this.Resources["sv"] as ScrollViewer;
    Canvas canvas1 = scrollview1.Content as Canvas;
    canvas1.Name = "canvas1";
    Canvas_Paint(ref canvas1); // Canvas_Paint defines the background color of "canvas1"
    scrollview1.VerticalAlignment = VerticalAlignment.Stretch;
    canvas1.Height = 400 + 400 * count;
    scrollview1.Content = canvas1;
    tab.Content = scrollview1;
    // insert tab item right before the last (+) tab item
    _tabItems.Insert(count - 1, tab);
    return tab;
    It may not provide that much benefits in this scenario though since you are setting the height and the background of the Canvas dynamically but it is indeed possible.
    Hope that helps.
    Please remember to close your threads by marking helpful posts as answer and then start a new thread if you have a new question.

  • NEED HELP about file handling and searching

    Hi guys !!!!!!!!!!!!!!
    A) I need a help from u i wrote this programme to read from the file and assign the lines for the string array.
    import java.io.*;
    public class ReadFile{
    public static void main(String[] args){
    int i;
    BufferedReader file;
    String line() = null;
    String fileName = "xx.txt";
              try {
                   file = new BufferedReader(new FileReader(fileName));
    for(i=1;i<=10;i++){
    line(i)= file.readLine();
    System.out.println(line(i));
    file.close();
              } catch (FileNotFoundException e) {
                   System.out.println("File: " + fileName + " not found.");
              } catch(IOException e) {
                   System.out.println("Error reading data from file: " + fileName);
    the thing is it is compiling but when interpritting it gives the error
    Exception in thread "main" java.lang.NullPointerException in line(i)= file.readLine();
    plese help me on this and
    B) i want to know how to search the string array to find 4 letter words.
    i'm taking the each element which is line(i) one at a time and search it.
    Plese help me on these issues !!!!!!!!!!!!!!!!!!!!!

    You try to create an array with line(i) (as far as i see) but you dont need to keep each line in memory. As far as i understand you just need to process lines sequentially.. (Null pointer exception is thrown because you did not create your array properly!)
    Look at this code:
    http://www.java-tips.org/java-se-tips/java.io/reading-text-from-a-file.html
    You just need to define process method in that code. (and of course try to understand). So as far as i see, you will check for 4-letter words inside process method!
    For detecting 4-character word, you need to extract the words in the line using StringTokenizer:
    http://www.java-tips.org/java-se-tips/java.util/how-to-use-stringtokenizer.html
    Then you can just just use length() method of String class:
    http://java.sun.com/j2se/1.3/docs/api/java/lang/String.html
    And if you need more advanced logic for processing the lines(currently seems to be the length of strings), you may try regular expressions:
    http://java.sun.com/docs/books/tutorial/essential/regex/index.html
    http://www.java-tips.org/java-se-tips/java.util.regex/

  • Help in Collections (LinkedList) and in Files I/O

    Well, I've two questions, first one:
    I'm trying to do a program which reads and writes (well, I'm only in the reading part :P) from/to Files with a kinda complex Layout (is it the word???) using java.io.*; it has the same limit of number of characters in every row, but it can be lower, and I don't know how to read them and store them in a String Array, specially an overloaded read() from my class where the paramters given are file, length in characters to read, and relative position in the layout... I kinda made a read() which reads ALL the text file... the first method returns a String[], but the last one returns String[][] (because I want to mantain the "layout")... What do you suggest me (well, at first try I was trying to use Data Bases but I really don't like the idea of basing my program in ANOTHER PROGRAM ... yes the one from Mycr0Zoft... I heard about making databases in Java is that true?, or I need that or any other program? Should I stay on the java.io.*???)
    the second question:
    When I Initialized the String[] and the String[][] to return in the read() methods I used an arbitrary (damn if that's not the word... I shouldn't have stopped studying the English language...!) size of [50]
    in the rows, I really find disgusting that thing, and I managed to use LinkedList to store them, BUT ONLY in the String[], because I can add the individual String Objects to de LinkedList, to simulate a String[], but i can't use it on the String[][] case, cuz, as you may now, I can't add an Object[] to that collection...
    Any Suggestions???
    Thnx ...

    Yeah, I have a suggestion. Lay off the reefer.
    Apart from that, perhaps BufferedReader would be helpful...it sounds like your input may be separated by newline into individual records (that is, each line is a logically separate bunch of data, pretty typical).
    Using a List to hold each line seems fine, but if you find that you have a "layout" (and it's not at all clear what you're talking about when you say that) then perhaps you should define a class that encapsulates that layout, and maintain a List of those.
    But don't worry about any of this until you come down. For now, listen to some Allman Brothers, and drink plenty of water. Stay at home; you don't want to be driving or trying to ride a bus right now.

  • RE: design patterns involving EJBs and JDO

    Is the idea that you specify in some config file (xml?) the methods of
    your session bean, whether its stateful or stateless, the default bean
    transaction semantics, etc, then say "go" and it generates the home and
    remote interfaces and the skeletal session bean class?
    -----Original Message-----
    From: Eric Lindauer [mailto:[email protected]]
    Sent: Monday, June 25, 2001 8:26 AM
    To: JDO-ListServ
    Subject: Re: design patterns involving EJBs and JDO
    I don't think it's publicly available yet, I used to work there and was
    helping out a little with testing. I'll tell you in advance, it really
    works well. Much like the JDO implementation, the process of turning
    things into SesisonBeans is very transparent to the developer. I guess
    TT is going to make it available in another week or two, as time
    permits.
    ----- Original Message -----
    From: Matthew <mailto:[email protected]> Adams
    To: '[email protected]' <mailto:'[email protected]'>
    Sent: Monday, June 25, 2001 11:18 AM
    Subject: RE: design patterns involving EJBs and JDO
    IMHO, JDO replaces entity beans, but you'll have to decide for yourself.
    My recommendation would be to use session beans exclusively.
    Where do you get TechTrader's "SessionBean Creator"? What are its
    features? How do you use it?
    -----Original Message-----
    From: Eric Lindauer [mailto:[email protected]]
    Sent: Monday, June 25, 2001 8:12 AM
    To: JDO-ListServ
    Subject: design patterns involving EJBs and JDO
    Hi,
    I was just wondering, if you are using JDO for persistence, does it
    matter whether you wrap your objects with proxy EntityBeans or
    SessionBeans? I am currently demoing TechTrader's SessionBean creator,
    which makes means that for me creating SessionBeans is much easier than
    creating EntityBeans. I am currently using stateful SessionBeans to
    wrap the JDO objects, simply dropping them when the bean is passivated
    and refinding them ( they'll already be in the cache ) when the bean is
    activated.
    My main advantage in doing it this way is SessionBeans are so much
    easier to create. Do you see any problems looming, or any other
    advantages to this decision?
    Thanks in advance.
    Eric

    I don't think it's publicly available yet, I used to work there and was
    helping out a little with testing. I'll tell you in advance, it really
    works well. Much like the JDO implementation, the process of turning
    things into SesisonBeans is very transparent to the developer. I guess
    TT is going to make it available in another week or two, as time
    permits.
    ----- Original Message -----_
    From: Matthew <mailto:[email protected]> Adams_
    To: '[email protected]' <mailto:'[email protected]'>
    Sent: Monday, June 25, 2001 11:18 AM
    Subject: RE: design patterns involving EJBs and JDO
    IMHO, JDO replaces entity beans, but you'll have to decide for yourself.
    My recommendation would be to use session beans exclusively.
    Where do you get TechTrader's "SessionBean Creator"? What are its
    features? How do you use it?
    -----Original Message-----
    From: Eric Lindauer [mailto:[email protected]]
    Sent: Monday, June 25, 2001 8:12 AM
    To: JDO-ListServ
    Subject: design patterns involving EJBs and JDO
    Hi,
    I was just wondering, if you are using JDO for persistence, does it
    matter whether you wrap your objects with proxy EntityBeans or
    SessionBeans? I am currently demoing TechTrader's SessionBean creator,
    which makes means that for me creating SessionBeans is much easier than
    creating EntityBeans. I am currently using stateful SessionBeans to
    wrap the JDO objects, simply dropping them when the bean is passivated
    and refinding them ( they'll already be in the cache ) when the bean is
    activated._
    My main advantage in doing it this way is SessionBeans are so much
    easier to create. Do you see any problems looming, or any other
    advantages to this decision?
    Thanks in advance.
    Eric_

  • Another Freezing Thread

    After the latest update(I just got my ipod working after it was broken for a few months from another porblem, so I just now got the latest update) my Ipod has been locking up anywhere from 3seconds to 3 minutes after I start playing a song. I can reset it (by holding menu and select) but seeing as it happens EVERY time, that's not much of a solution. I've seen many threads like this and the only advice I've seen is to do the 5 R's, which I have done many times, with no luck. I even tried formating my Ipod with HP USB Disk Storage Format Tool but that hasn't helped either. Can anyone give me some advice BESIDES doing the 5 R's? Any help would be appreciated.
    Edit: I have the 5th generation 30gb Ipod if that helps any.

    might a low-level format help in this case ?
    (sry for double post)

  • What Are the Differences Between String and StringBuffer?

    Both String and StringBuffer are final classes. StringBuffer grows in size dynamically. Could people help to detail other differences between String and StringBuffer?

    String is immutable. In other words, once it is made, the contents of that instance of String cannot be changed (easily). The size and characters cannot be changed, and code can take advantage of this fact to optimize space. Also, once you have a reference to a string, you do not need to worry about it changing at all, so you can eliminate constant tests to verify things such as size in another class that may want to hold onto the string.
    StringBuffer, as you noticed, can change dynamically. While this provides flexibility, it cannot be optimized and assumptions cannot be made as with strings. If a class holds a reference to a StringBuffer that it does not own, there is a possibility that it may change things such as size when the class tries to use it later. StringBuffer is also less efficient in handling space then an equivalent String. The character array to hold a String is exactly the length to hold all the characters. StringBuffer, on the other hand, adds a 16 character buffer of array space for possible expansions. Also, the size of the internal array doubles when its internal capacity is exceeded. So, unless you explicitly maintain the size, a StringBuffer will take up more memory then an equivalent String, and if your program needs thousands of instances of Strings (which is not uncommon), that space can add up.
    I hope this helps clarify some things for you.
    -JBoeing

Maybe you are looking for