Search:

Type: Posts; User: summit45

Page 1 of 2 1 2

Search: Search took 0.47 seconds.

  1. Replies
    2
    Views
    208

    Re: Java Program String Arrays Problem

    Honestly, it was too convoluted for me to figure out why it was doing what it was doing. Right off I saw you were trying to make while() loops do for() loop work. Also that assignment of keyA[i] to...
  2. Re: Begineer mistakes, need help (very basic)

    public double calculateaverageconsumption(int byDistance, int byConsommation) {
    float calculateaverageconsumption = (float) byDistance / byConsommation;

    return averageconsumption;
    }
    ...
  3. Re: ERROR : "CLASS NAME IS ABSTRACT CANNOT BE INSTATIATED"

    So you just decided to declare the class abstract even though you didn't understand what abstract classes were for?

    Can I ask, why?

    -summit45
  4. Replies
    9
    Views
    178

    Re: Incomprehensible bug

    Well I have run the "Build & Clean" option more than once already. Same issue. Even so, there was never a version of the code where decode() was called from the constructor anyway. Could it be a...
  5. Replies
    9
    Views
    178

    Re: Incomprehensible bug

    Yeah, it only gives me bad output when I execute it in NetBeans. I have no idea why that would be so. It works even if I execute it from the command line in the NetBeans build folder for this...
  6. Replies
    9
    Views
    178

    Re: Incomprehensible bug

    SSCCE version (still requires -d command line arg just in case that's somehow part of the problem):


    import java.io.IOException;
    import java.io.File;
    import java.io.FileWriter;
    import...
  7. Replies
    9
    Views
    178

    Incomprehensible bug

    I am really lost on this one.

    I am creating (just for my own practice and because it's kind of cool) a program to encrypt a string according to a very basic algorithm I designed. That part works...
  8. Re: What is the difference between a statement surrounded by curly brackets and one that isn't?

    Yeah I got him, that's what I said, or so I thought lol. Well I didn't talk about that first if() without braces but yeah exactly, that's just it. If you put that println() inside the if(), and the...
  9. Establishing an AudioFormat for a TargetDataLine

    I once wrote a simple program - that turned out to have no use, but was good practice - that simply takes microphone input and routes it right back out the speakers.

    There were several oddities in...
  10. Re: What is the difference between a statement surrounded by curly brackets and one that isn't?

    Well if it throws that exception, that breaks out of the try {} block, and executes the catch statement. And if the number is in range, the if() {} block doesn't execute, so either way, that...
  11. Re: What is the difference between a statement surrounded by curly brackets and one that isn't?

    The if() {} statement is not inside a try {} block, so there is nothing to catch that exception, and the program will end.

    If a number out of range is entered, the program stops running.

    If a...
  12. Replies
    26
    Views
    366

    [SOLVED] Re: Automatic audio file player not working

    However, you are of course right that code ought to be commented. I decided to comment it because it is possible I will want to show it to my university or someone to show what I taught myself...
  13. Re: First day of ever working with Java.. Already confused -.-

    To get the percent of a number, you multiply it by the percentage value with the decimal two places to the left. So ten percent of 60 = 60 * 0.10.

    So just get your input, set the var to: var +=...
  14. Re: Representing the return key in a regular expression

    Which it does, indeed. I resent the implication that I'm too stupid to look for the answer elsewhere before asking here. I am asking because I could not find it.

    You say you have better things...
  15. Representing the return key in a regular expression

    Quick question that my last program made me want to ask. I found another solution that didn't require me to do this for the program, but it got me curious: How do you represent a return key in a...
  16. Replies
    26
    Views
    366

    [SOLVED] Re: Automatic audio file player not working

    And I haven't asked anyone to read it. I put it up in case it was to interest of anyone searching the web or the forums looking for answers to a similar problem, or if someone had a comment they...
  17. Replies
    26
    Views
    366

    [SOLVED] Re: Automatic audio file player not working

    Believe me when I tell you that I'm pretty confident no human being besides me is ever going to have to reprogram this, and if that day comes, I will put comments in it.

    -summit45
  18. Replies
    26
    Views
    366

    [SOLVED] Re: Automatic audio file player not working

    It just does what you said. Declares Calendar objects representing each target time, and parses their Epoch time through a Date object into a long var. Then establishes the current Epoch time, and...
  19. Replies
    26
    Views
    366

    [SOLVED] Re: Automatic audio file player not working

    Well, this forum just lost me my last two posts, so here goes an approximate re-do:

    You were right about the CPU usage! I had no idea it would be that bad over a little loop. But yeah, I have...
  20. Replies
    26
    Views
    366

    [SOLVED] Re: Automatic audio file player not working

    How would you do it? Like I said, I know most of the code I write could be improved. That's because I'm quite new to Java and teaching it to myself. I have no idea how I would compute the time to...
  21. Replies
    26
    Views
    366

    [SOLVED] Re: Automatic audio file player not working

    Well, the program works now. Doesn't do quite everything I'd like, but it's good enough, it runs, it will get the job done I believe.

    I thank everyone who replied for their help!

    -summit45
    ...
  22. Replies
    26
    Views
    366

    [SOLVED] Re: Automatic audio file player not working

    Does start() normally finish playing the audio file it references before allowing execution to continue?

    -summit45
  23. Replies
    26
    Views
    366

    [SOLVED] Re: Automatic audio file player not working

    println()'s would show me what's happening and when, but not why - and indeed as the code stands now, they already DO show that the for() loop in the FilePlayer is being called twice, one time...
  24. Replies
    26
    Views
    366

    [SOLVED] Re: Automatic audio file player not working

    I understand that. When I wrote it, I figured it was probably rather disgusting code-wise, but again, I am inexperienced, but I figure the best way to learn is to go do it, even if it isn't perfect...
  25. Re: Generating random numbers in java without repeating a specific number

    EDIT: Ignore this post. I misunderstood what the OP wanted and created a solution to a problem that didn't exist. I'll take a look later and see if I can come up with something - I have a vague...
Results 1 to 25 of 48
Page 1 of 2 1 2