3 java questions: debugging, templating and Swing app for Texts cleansing

Discussion in 'Java' started by lbrtchx@hotmail.com, Apr 29, 2007.

  1. Guest

    // __ how do you debug debug:
    ~
    Exception in thread "main" java.lang.OutOfMemoryError: Java heap
    space
    ~
    kinds of errors?
    ~
    // __ How can you make this method taking in an array on ints and
    enlarging it, make the same thing for long[]('s), byte[]('s) in fact
    any possible array.
    ~
    // __ (((iAr != null) && ((iArL = iAr.length) > 0)) || (iNwL > 0))
    public int[] _enlargeIntArr(int[] iAr, int iNwL) throws
    InputContextException{
    boolean Is = false;
    int[] iNwAr = null;
    int iArL;
    // __
    if((iAr != null) && ((iArL = iAr.length) > 0)){
    if(iNwL > iArL){
    iNwAr = new int[iNwL];
    System.arraycopy(iAr, 0 , iNwAr, 0, iNwL);
    iAr = null;
    System.gc();
    }// (iNwL > iArL)
    else{
    String aX = "// __ New Length must be greater than previous one.
    iNwL: |" + iNwL + "|, iArL: |" + iArL + "|";
    throw new InputContextException(aX);
    }
    }// ((iAr != null) && ((iArL = iAr.length) > 0))
    else if(iNwL > 0){ iNwAr = new int[iNwL]; }
    else{
    String aX = "// __ New Length must be greater than 0. iNwL: |" +
    iNwL + "|";
    throw new InputContextException(aX);
    }
    // __
    return(iNwAr);
    }
    ~
    // __ Do you know of any swing application to compare two text files,
    partially programatically, partially by eyeballing them?
    The j app. should syncronize teh scrolling of both texts to that the
    same section would be visible even if you scroll one of them
    ~
    thanks
    lbrtchx
     
    , Apr 29, 2007
    #1
    1. Advertising

  2. Daniel Pitts Guest

    On Apr 29, 2:03 pm, wrote:
    > // __ how do you debug debug:
    > ~
    > Exception in thread "main" java.lang.OutOfMemoryError: Java heap
    > space

    There are heap profilers out there which will tell you what objects
    are allocated.
    > ~
    > kinds of errors?
    > ~
    > // __ How can you make this method taking in an array on ints and
    > enlarging it, make the same thing for long[]('s), byte[]('s) in fact
    > any possible array.
    > ~

    [snip code]
    You can't really... Java Generics are not like C++ Templates. They may
    have a similar appearance, but their functionality is quite different
    except in the most basic cases. If you need to support multiple types
    of arrays of primitives, you have to manually support it.
    > ~
    > // __ Do you know of any swing application to compare two text files,
    > partially programatically, partially by eyeballing them?
    > The j app. should syncronize teh scrolling of both texts to that the
    > same section would be visible even if you scroll one of them

    I don't know about a swing application specifically, but there are
    plenty of graphical diff programs available. google is your friend.

    > ~
    > thanks
    > lbrtchx


    Hope this helps.
     
    Daniel Pitts, Apr 29, 2007
    #2
    1. Advertising

  3. shterke Guest

    On Apr 29, 6:29 pm, Daniel Pitts <> wrote:
    > On Apr 29, 2:03 pm, wrote:> // __ how do you debug debug:
    > > ~
    > > Exception in thread "main" java.lang.OutOfMemoryError: Java heap
    > > space

    >
    > There are heap profilers out there which will tell you what objects
    > are allocated.> ~
    > > kinds of errors?
    > > ~
    > > // __ How can you make this method taking in an array on ints and
    > > enlarging it, make the same thing for long[]('s), byte[]('s) in fact
    > > any possible array.
    > > ~

    >
    > [snip code]
    > You can't really... Java Generics are not like C++ Templates. They may
    > have a similar appearance, but their functionality is quite different
    > except in the most basic cases. If you need to support multiple types
    > of arrays of primitives, you have to manually support it.> ~
    > > // __ Do you know of any swing application to compare two text files,
    > > partially programatically, partially by eyeballing them?
    > > The j app. should syncronize teh scrolling of both texts to that the
    > > same section would be visible even if you scroll one of them

    >
    > I don't know about a swing application specifically, but there are
    > plenty of graphical diff programs available. google is your friend.
    >
    > > ~
    > > thanks
    > > lbrtchx

    >
    > Hope this helps.


    cool
     
    shterke, Apr 30, 2007
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Big Daddy

    Java 1.2 Swing vs. Java 1.5 Swing

    Big Daddy, Apr 15, 2005, in forum: Java
    Replies:
    2
    Views:
    525
    Pete Barrett
    Apr 16, 2005
  2. John
    Replies:
    2
    Views:
    752
    Thomas Weidenfeller
    May 19, 2005
  3. lrantisi
    Replies:
    2
    Views:
    424
    RedGrittyBrick
    Nov 10, 2006
  4. lrantisi
    Replies:
    0
    Views:
    298
    lrantisi
    Nov 9, 2006
  5. Stefan Ram

    How to scan Java source texts?

    Stefan Ram, Jun 11, 2013, in forum: Java
    Replies:
    14
    Views:
    412
    Jeff Higgins
    Jun 12, 2013
Loading...

Share This Page