Search:

Type: Posts; User: andreas90

Page 1 of 12 1 2 3 4

Search: Search took 0.39 seconds.

  1. Replies
    20
    Views
    1,006

    [SOLVED] Re: Number of permurations an memory problems.

    I have given up the approach with the permutations since it seems like a dead end. I'm working on a different approach now.
  2. Replies
    20
    Views
    1,006

    [SOLVED] Re: Number of permurations an memory problems.

    As I said in my previous post this will effect the computational time of the program.
    In each run of the algorithm, the method that creates the permutations is called many times. Therefore the...
  3. Replies
    20
    Views
    1,006

    [SOLVED] Re: Number of permurations an memory problems.

    Thanks for your suggestion.
    Unfortunately, at some point I'll need all the permutations together in the ArrayList to do some stuff with them, so the exception may be avoided when I'm generating them...
  4. Replies
    20
    Views
    1,006

    [SOLVED] Re: Number of permurations an memory problems.

    Unfortunately I need the combinations/permutations themselves. Finding the number of them was a "trick" to improve the time and memory usage. ie using an ArrayList with initial size (which is the...
  5. Replies
    4
    Views
    632

    [SOLVED] Re: BufferedReader skips odd numbered lines

    You are welcome.


    Each time you call the readLine() method a line in your text file is read.
    Your text file is:

    and your code:

    try {
    while((r.readLine())!=null){
  6. Replies
    20
    Views
    1,006

    [SOLVED] Re: Number of permurations an memory problems.

    Hello aesguitar!

    You are right about my RAM, it's 3GB. As you can see from the code I posted I keep the permutations, not combinations. My new approach involves finding the combinations (which are...
  7. Replies
    4
    Views
    632

    [SOLVED] Re: BufferedReader skips odd numbered lines

    Hello beer-in-box!

    It's pretty simple what is wrong with your code.

    try {
    while((r.readLine())!=null){

    w = r.readLine();

    System.out.println(w);
  8. Replies
    20
    Views
    1,006

    [SOLVED] Re: Number of permurations an memory problems.

    Hello Z!

    Thanks for the time you spent on my problem. I tried calculating P(n,r) as you suggested and it worked as I thought. I don't get a java.lang.OutOfMemoryError exception in the internal...
  9. Replies
    20
    Views
    1,006

    [SOLVED] Re: Number of permurations an memory problems.

    The number of permutations is P(n,r) = n!/(n-r)!
    So for n=60 and r=4 I have P(60,4) = 60! / (60 - 4)! = 11703240 permutations.

    I tried the same method with each quadraplet being a String instead...
  10. Replies
    20
    Views
    1,006

    [SOLVED] Re: Number of permurations an memory problems.

    I didn't explain well what I'm doing. This is the method that causes the java.lang.OutOfMemoryError exception I posted in post#2. I generate P(n,r) permutations which for the following method is...
  11. Replies
    20
    Views
    1,006

    [SOLVED] Re: Number of permurations an memory problems.

    It should be equal to the number of the permutations , if I'm getting right what you asked.

    You mean if I need all the permutations? Yes, I need them because I want to search every possible...
  12. Replies
    20
    Views
    1,006

    [SOLVED] Re: Number of permurations an memory problems.

    When I try to solve a large instance of the problem I get the following error:

    Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
    at java.util.Arrays.copyOf(Unknown...
  13. Replies
    20
    Views
    1,006

    [SOLVED] Number of permurations an memory problems.

    Hello guys!

    I'll give you the big picture of what I'm doing. I'm solving a combinatorial optimization problem. I find an initial solution and then try to improve it with some heuristics. One of...
  14. Re: Saving information from arrays. I think.

    Hello EatMyBible!



    You are right. You need to somehow use the input to make your calculations.
    Since the input is in [0,10) and your array has length 10, you can use input as the index of the...
  15. Thread: JAVA vs ALL

    by andreas90
    Replies
    10
    Views
    531

    Re: JAVA vs ALL

    Καλωσήρθες! Ψάχνω καιρό για Έλληνα στο φορουμ. Και ό,τι θες στείλε και προσωπικό μήνυμα αν μπορώ να βοηθήσω, αν και υπάρχουν πολύ πιο καταρτισμένα άτομα από μένα και σίγουρα μπορούν να βοηθήσουν...
  16. Thread: JAVA vs ALL

    by andreas90
    Replies
    10
    Views
    531

    Re: JAVA vs ALL

    That's true. A side note, if I were interested in a career as a software engineer in Greece, I would definitely spent time learning C# and the .NET framework since it is very very popular in...
  17. Replies
    2
    Views
    217

    Re: Var Might have been initialize

    Hello Evilreaper!



    The error message is pretty clear. You should initialize that variable. And another think I noticed:

    if( PaymentTerm == CREDIT )
    You should use the String's equals...
  18. Replies
    14
    Views
    328

    Re: Trouble appending data to Excel

    Hello loui345!

    I have very little experience with Apache Poi and just tried your code with the same results as yours. But this stackoverflow thread and the Apache Poi Busy Developers' Guide seem...
  19. Replies
    15
    Views
    343

    Re: Encrypter not working

    Yoe are welcome. I would try a HashMap with the regular words as keys and the encrypted ones as values. Read the link for further information.
  20. Replies
    15
    Views
    343

    Re: Encrypter not working

    The "encrypted" word is set inside every if statement. I talk about the statement
    jtfResult.setText(display + "" + "" + ""); which is BEFORE the if statements.
    The way it is your code now when the...
  21. Replies
    15
    Views
    343

    Re: Encrypter not working

    Did you print what is being tested (ie jtfResult.getText())?
    What is the purpose of the statement
    jtfResult.setText(display + "" + "" + "");
    Why don't you test directly the textfield's text?
  22. Replies
    15
    Views
    343

    Re: Encrypter not working

    I can see two problems in your code. Firstly, you didn't follow my hint in post #2. Your if statements are wrong. They don't have an error but the semicolon in the end of them is a logic error. Try...
  23. Replies
    15
    Views
    343

    Re: Encrypter not working

    Can you show the code you tried? Or better a sample of it that shows the problem and can be executed without errors?
  24. Replies
    15
    Views
    343

    Re: Encrypter not working

    Hello maxattack!

    You have some logic errors (probably by mistake).


    if (jtfResult.getText().equals("d"));
    .
    .
    .
  25. Replies
    5
    Views
    712

    [SOLVED] Re: returning null instead of int

    Hello Mike!



    Yes, you are correct. You must return a value of that type. There is no way you can avoid that - as far as I know.
    A common way to handle this situation is to have some "default"...
Results 1 to 25 of 281
Page 1 of 12 1 2 3 4