User Profile

Collapse

Profile Sidebar

Collapse
Aardsquid
Aardsquid
Last Activity: Dec 13 '08, 10:55 PM
Joined: Nov 22 '08
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • Aardsquid
    replied to user tracking
    in Java
    While not strictly a Java solution, the HTTP header field called "referer" generally has a URI to the linking document. The W3C HTTP/1.1 Header Field Definitions (section 14.36) gives a brief overview.

    Best regards!
    See more | Go to post

    Leave a comment:


  • Aardsquid
    replied to Need help with input validation
    First off, I'd get rid of this:
    Code:
    qnty = (stwqnty*1) + (corqnty*1);
    And replace it with this:
    Code:
    qnty = stwqnty.parseInt() + corqnty.parseInt();
    Before the line parsing the quantity, use a quick regular expression:
    Code:
    if (!(stwqnty + corqnty).match ( /^[0-9]$/ )) {
        // Error message
        return;
    }
    That just makes sure that the string is the characters 0-9 throughout.

    Best regards!...
    See more | Go to post
    Last edited by Aardsquid; Nov 23 '08, 10:51 PM. Reason: Not clear

    Leave a comment:


  • Aardsquid
    replied to need help
    in Java
    Well, to call a method in another class is quite simple:
    Code:
    OtherClass.method ( /*args*/ );
    It looks like the instructions at some point ask to create a Player class. Make it private and put it inside Game; add the fields:
    Code:
    private class Player {
        private String name;
        private int score;
    }
    The constructor needs to set the name, that's it. It might be good to have a get and set method for...
    See more | Go to post

    Leave a comment:


  • Aardsquid
    replied to InputStream help
    in Java
    It looks to me like you haven't initialized filePosition. Try setting it to 0 at the beginning of the method.
    See more | Go to post

    Leave a comment:

No activity results to display
Show More
Working...