Page 9 of 11 FirstFirst ... 7891011 LastLast
Results 161 to 180 of 219
Like Tree22Likes

Thread: How to do this?

  1. #161
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,902
    Rep Power
    25

    Default Re: How to do this?

    Did you add some println() statements inside the loops that printed out the value of element to see if it was changing as you hoped?

    What was printed?
    If you don't understand my response, don't ignore it, ask a question.

  2. #162
    Tawi is offline Senior Member
    Join Date
    Feb 2013
    Posts
    118
    Rep Power
    0

    Default Re: How to do this?

    No, the most important things are the code is working, how to fix the code?

  3. #163
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,783
    Blog Entries
    7
    Rep Power
    21

    Default Re: How to do this?

    More than 160 replies and still the OP refuses to sprinkle in some System.out.println( ... ) statements; the code still doesn't seem to work and the OP asks 'how to fix the code'? again; this thread is surreal.

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  4. #164
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,902
    Rep Power
    25

    Default Re: How to do this?

    how to fix the code?
    Before you can fix it, you need to know exactly what is wrong with it.
    If you don't understand my response, don't ignore it, ask a question.

  5. #165
    Tawi is offline Senior Member
    Join Date
    Feb 2013
    Posts
    118
    Rep Power
    0

    Default Re: How to do this?

    With the code, the program is not working and without it, the program is working, is that not enough? I cannot add println to the code if that stupid code that is bugging me is not removed. It is wasting my time because the program do not do any things. So, spare me, will you?
    Last edited by Tawi; 03-11-2014 at 06:57 PM.

  6. #166
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,902
    Rep Power
    25

    Default Re: How to do this?

    You need to find out the cause of the problem. When you find that, work on fixing it.
    If you don't understand my response, don't ignore it, ask a question.

  7. #167
    gimbal2 is offline Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    4,365
    Rep Power
    6

    Default Re: How to do this?

    Quote Originally Posted by Norm View Post
    You need to find out the cause of the problem. When you find that, work on fixing it.
    Someone needs to put more gas in Norm, his tank's almost empty as he's reverted to the "You need to find the problem and fix it" advice.

    Excellent mileage though!
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

  8. #168
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,902
    Rep Power
    25

    Default Re: How to do this?

    I'm beginning to wonder if this is like Sisyphus's problem
    or a plot from Kafka
    If you don't understand my response, don't ignore it, ask a question.

  9. #169
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,783
    Blog Entries
    7
    Rep Power
    21

    Default Re: How to do this?

    Quote Originally Posted by Norm View Post
    I'm beginning to wonder if this is like Sisyphus's problem
    or a plot from Kafka
    It's more like a broken record; it plays the same sad song over and over again. (agreed, it resembles Sisyphus ;-)

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  10. #170
    jim829 is online now Senior Member
    Join Date
    Jan 2013
    Location
    Northern Virginia, United States
    Posts
    4,033
    Rep Power
    6

    Default Re: How to do this?

    I still think it is a Turing test.

    Regards,
    Jim
    kjkrum likes this.
    The JavaTM Tutorials | SSCCE | Java Naming Conventions
    Poor planning on your part does not constitute an emergency on my part

  11. #171
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,783
    Blog Entries
    7
    Rep Power
    21

    Default Re: How to do this?

    Quote Originally Posted by jim829 View Post
    I still think it is a Turing test.
    Why do you still think it's a Turing test?

    kind regards,

    Elisa
    cenosillicaphobia: the fear for an empty beer glass

  12. #172
    jim829 is online now Senior Member
    Join Date
    Jan 2013
    Location
    Northern Virginia, United States
    Posts
    4,033
    Rep Power
    6

    Default Re: How to do this?

    Tell me more about yourself, Elisa.

    Regards,
    Alan
    The JavaTM Tutorials | SSCCE | Java Naming Conventions
    Poor planning on your part does not constitute an emergency on my part

  13. #173
    gimbal2 is offline Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    4,365
    Rep Power
    6

    Default Re: How to do this?

    Well its some kind of test! I think I failed.
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

  14. #174
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,783
    Blog Entries
    7
    Rep Power
    21

    Default Re: How to do this?

    Quote Originally Posted by gimbal2 View Post
    Well its some kind of test! I think I failed.
    Do you always feel like that after sex?

    kindest regards,

    Elisa ;-)
    cenosillicaphobia: the fear for an empty beer glass

  15. #175
    gimbal2 is offline Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    4,365
    Rep Power
    6

    Default Re: How to do this?

    Quote Originally Posted by JosAH View Post
    Do you always feel like that after sex?
    Not always but sometimes, yeah :(
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

  16. #176
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,783
    Blog Entries
    7
    Rep Power
    21

    Default Re: How to do this?

    Quote Originally Posted by gimbal2 View Post
    Not always but sometimes, yeah :(
    You shouldn't practice position 96; I mean, all you can to is talk ...

    kind regards,

    Jos (<--- sexuologist)
    cenosillicaphobia: the fear for an empty beer glass

  17. #177
    gimbal2 is offline Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    4,365
    Rep Power
    6

    Default Re: How to do this?

    Okay this is getting too weird, I give up. I FAIL AGAIN!
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

  18. #178
    kneitzel is offline Senior Member
    Join Date
    Feb 2014
    Posts
    447
    Rep Power
    1

    Default Re: How to do this?

    Hmm ... So we develop an Elisa module for this forum that moderators can activate? I think there is a real need to have something like that.

    But did I understand the the core problem right:
    - He wrote some code that is compiling right now but not doing what he wants to.
    - When he tried to insert some debug output, he was unable to compile the code any longer?

    I simply must have missed something.

    Konrad

  19. #179
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,902
    Rep Power
    25

    Default Re: How to do this?

    @Konrad I thought one of the problems was an infinite loop.
    Look at the variable: element in post#158
    If you don't understand my response, don't ignore it, ask a question.

  20. #180
    Tawi is offline Senior Member
    Join Date
    Feb 2013
    Posts
    118
    Rep Power
    0

    Default Re: How to do this?

    Guys, I have another problem. The error code is not postable so? If Java meets these lines, what will it do? Please tell me the steps that are used by it to process these lines? Which one will be processed first, second, third, and so on?

    Java Code:
    public void lanjutkanKriteria() {
                    if (xyz[c] <= 3) {
                        if (xyz[c] == 0) {
                            xyzisi0(); 
                            kmbl[c].setEnabled(true);
                            xyz[c]++;
                            labelKriteria[c].setText(lblKriteria[xyz[c]][c]);
                            kriteriaLanjut[c].setText(lblKriteria[xyz[c] + 1][c]);
                            kmbl[c].setText(lblKriteria[xyz[c] - 1][c]);
                            System.out.println(xyz[c]);
                            System.out.println(labelKriteria[c]);
                            System.out.println(kriteriaLanjut[c]);
                            System.out.println(kmbl[c]);
                        }
                    else if ((xyz[c] > 0) && (xyz[c] < 3)) {
                        if (xyz[c] == 1) {xyzisi1();}
                        else if (xyz[c] == 2) {xyzisi2();}
                        xyz[c]++;
                        kmbl[c].setText(lblKriteria[xyz[c] - 1][c]);
                        System.out.println(xyz[c]);
                        System.out.println(kmbl[c]);
                        if ((xyz[c] + 1) <= 3) {
                            kriteriaLanjut[c].setText(lblKriteria[xyz[c] + 1][c]);
                            labelKriteria[c].setText(lblKriteria[xyz[c]][c]);
                            System.out.println(labelKriteria[c]);
                            System.out.println(kriteriaLanjut[c]);                        
                        }
                        else if ((xyz[c] + 1) > 3) {
                            kriteriaLanjut[c].setText("Proses");
                            labelKriteria[c].setText(lblKriteria[xyz[c]][c]);
                            System.out.println(labelKriteria[c]);
                            System.out.println(kriteriaLanjut[c]);                        
                        }
                    } 
                    else if (xyz[c] == 3) {
                        xyzisi3();
                        kriteriaLanjut[c].setText("");
                        kriteriaLanjut[c].setEnabled(false);
                        kmbl[c].setText(lblKriteria[xyz[c]][c]);
                        labelKriteria[c].setText("");
                        System.out.println(labelKriteria[c]);
                        System.out.println(kriteriaLanjut[c]);
                        System.out.println(kmbl[c]);
                        for (int tyu = 75; tyu <jawabAlternatif.length; tyu++){
                        jawabAlternatif1[tyu][c].setEnabled(false);}
                        long start = System.currentTimeMillis();
                        perhitunganAHP();  
                        long elapsed = System.currentTimeMillis() - start;
                        JOptionPane.showMessageDialog(null, "Part three took: " + elapsed, "Pesan Informasi", JOptionPane.INFORMATION_MESSAGE); 
                        do {
                            for(int jtk = 0; jtk < 16; jtk++) {
                                variabelTampungK[jtk][c] = String.valueOf(MHPKT[jtk][c]);
                                System.out.println(variabelTampungK[jtk][c]);                        
                            }
                        perhitunganAHPK();
                        }
                        while (DHNKT[0][c] > 0.001 || DHNKT[1][c] > 0.001 || DHNKT[2][c] > 0.001 || DHNKT[3][c] > 0.001);                       
                        do {
                            for(int jtk = 0; jtk < 25; jtk++) {
                                variabelTampung[jtk][c] = String.valueOf(MHPAT[jtk][c]);
                                System.out.println(variabelTampungK[jtk][c]);
                            }
                        perhitunganAHPA1();
                        }
                        while (DHNAT[0][c] > 0.001 || DHNAT[1][c] > 0.001 || DHNAT[2][c] > 0.001 || DHNAT[3][c] > 0.001 || DHNAT[4][c] > 0.001);
                        do {
                            for(int jtk = 0 + 25; jtk < 25 + 25; jtk++) {
                                variabelTampung[jtk][c] = String.valueOf(MHPAT[jtk][c]);
                                System.out.println(variabelTampungK[jtk][c]);
                            }
                        perhitunganAHPA2();
                        }
                        while (DHNAT[0 + 5][c] > 0.001 || DHNAT[1 + 5][c] > 0.001 || DHNAT[2 + 5][c] > 0.001 || DHNAT[3 + 5][c] > 0.001 || DHNAT[4 + 5][c] > 0.001);
                        do {
                            for(int jtk = 0 + 50; jtk < 25 + 50; jtk++) {
                                variabelTampung[jtk][c] = String.valueOf(MHPAT[jtk][c]);
                                System.out.println(variabelTampungK[jtk][c]);
                            }
                        perhitunganAHPA3();
                        }
                        while (DHNAT[0 + 10][c] > 0.001 || DHNAT[1 + 10][c] > 0.001 || DHNAT[2 + 10][c] > 0.001 || DHNAT[3 + 10][c] > 0.001 || DHNAT[4 + 10][c] > 0.001);
                        do {
                            for(int jtk = 0 + 75; jtk < 25 + 75; jtk++) {
                                variabelTampung[jtk][c] = String.valueOf(MHPAT[jtk][c]);
                                System.out.println(variabelTampungK[jtk][c]);
                            }
                        perhitunganAHPA4();
                        }
                        while (DHNAT[0 + 15][c] > 0.001 || DHNAT[1 + 15][c] > 0.001 || DHNAT[2 + 15][c] > 0.001 || DHNAT[3 + 15][c] > 0.001 || DHNAT[4 + 15][c] > 0.001);
                        hitFinal();
                        JOptionPane.showMessageDialog(null, "Akhir Kriteria", "Pesan Kesalahan", JOptionPane.INFORMATION_MESSAGE);}
                    else if ((xyz[c] > 3) || (xyz[c] < 0)) {
                        JOptionPane.showMessageDialog(null, "Ada Kesalahan tidak Terduga", "Pesan Kesalahan", JOptionPane.INFORMATION_MESSAGE); 
                        xyz[c]--;}
                        System.out.println(xyz[c]);}
    }
    public void hitFinal(){
        perhitunganFinal();
        hitungBobotK();
        hitungBobotA();
        nilaiEigenK();
        nilaiEigenA();
        hitLamdaKriteria();
        hitLamdaAlternatif();
        hitKonsistensiIndeksK();
        hitKonsistensiIndeksA();
        hitKonsistensiRatioK();
        hitKonsistensiRatioA();
        consistency();
    }
    Last edited by Tawi; 03-13-2014 at 06:22 AM.

Page 9 of 11 FirstFirst ... 7891011 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •