Search:

Type: Posts; User: literallyjer

Page 1 of 3 1 2 3

Search: Search took 0.20 seconds.

  1. Replies
    6
    Views
    5,187

    Re: Method for Cedit card check, help!!!!1

    Here's one way to see if a number is even or odd.


    if (n % 2 == 0)
    // n is even
    else
    // in is odd
  2. Re: In a bit of a pickle, unsure of what I should do

    AMIS Technology blog » Blog Archive » Oracle RDBMS 11gR2 - Solving a Sudoku using Recursive Subquery Factoring
  3. Re: In a bit of a pickle, unsure of what I should do

    What is line 28?
  4. Thread: 2d Arrays

    by literallyjer
    Replies
    5
    Views
    3,446

    Re: 2d Arrays

    You program is returning 1 because that is what you told it to do. It is apparent (based on what you've said) that your code is getting to the first return statement before the last one. Since that...
  5. Replies
    6
    Views
    5,617

    Re: Delay/Wait/Pause in Java + AirBrushing

    For some reason it didn't click that you were using Swing. You have to be really careful when using multiple threads with Swing. I suggest you look into SwingUtilities.invokeLater() and...
  6. Thread: 2d Arrays

    by literallyjer
    Replies
    5
    Views
    3,446

    Re: 2d Arrays

    With out actually running your code, I would assume it has to do with the "return found" inside the last for loop. (Which also seems to be missing the "for" part of it..)
  7. Thread: Timer?

    by literallyjer
    Replies
    1
    Views
    2,126

    Re: Timer?

    A Timer itself does not know how to read from a text file.

    You would have to read from the text file first (See the thread "Scanner or BufferedReader" for help on that), then parse your data, and...
  8. Replies
    11
    Views
    23,617

    Re: Scanner vs BufferedReader?

    It really doesn't matter where the input comes from. For example:

    Scanner in = new Scanner(new File("myfile.txt");

    BufferedReader in = new BufferedReader(new FileReader(new File("myfile.txt"));...
  9. Re: In a bit of a pickle, unsure of what I should do

    Ooooh, but I wanted to be clever! *pouts*

    Haha, it is still a fun little exercise.
  10. Replies
    5
    Views
    6,980

    Re: sieve of eratosthenes

    To check if a number is even, you can do this:


    if (num % 2 == 0)
  11. Replies
    6
    Views
    5,617

    Re: Delay/Wait/Pause in Java + AirBrushing

    Thread.sleep() -- See the Java API for more details.

    The Java API: Java Platform SE 6
  12. Replies
    1
    Views
    4,997

    Re: Convert Maps of String to Map of Maps

    This is a perfect opportunity for you to read the Java API for Maps and Strings ;-)

    The Java API: Java Platform SE 6
  13. Re: In a bit of a pickle, unsure of what I should do

    Where do you get this null pointer?

    I have started writing a Sudoku solver myself. So far I have written all the setup code. Now we are both stuck at the same point: how to go about solving the...
  14. Re: In a bit of a pickle, unsure of what I should do

    Do you have any ideas?

    Half of the fun of coding is the thought that goes into it ;-)
  15. Re: In a bit of a pickle, unsure of what I should do

    Do you mean adding possible values to solve the puzzle? Well, I am not an expert sudoku puzzle solver, so I am not exactly sure how to proceed at the moment. How would you solve the puzzle in your...
  16. Replies
    6
    Views
    7,012

    Re: Writing clone() method for LinkedList

    You are very welcome :-)
  17. Re: In a bit of a pickle, unsure of what I should do

    I would still do it the way I started doing it above.

    I would make the file look like this:

    1,2:4
    4,9:8
    x,y:z

    where 1 is the horizontal position (the x value, or the first value in the...
  18. Replies
    6
    Views
    7,012

    Re: Writing clone() method for LinkedList

    I am assuming that line 14 is this:

    OurLinkedList <String>cloned = (OurLinkedList<String>)myList.clone();

    If that's the case, then you are trying to cast a LinkedList into your OurLinkedList....
  19. Re: In a bit of a pickle, unsure of what I should do

    From the looks of it, you already are using a two dimensional array...

    Since that's the case, why are you creating an array of Cells of size 81?
  20. Replies
    6
    Views
    7,012

    Re: Writing clone() method for LinkedList

    Why does your clone method repeatedly (assuming size is greater than 1) add "A" into the cloned list and not the values of the list it is cloning?
  21. Re: In a bit of a pickle, unsure of what I should do

    It might be easier to use a two dimensional array here, as it more accurately represents a Sudoku square.



    public class Sudoku {

    private Cell[][] square = new Cell[9][9];

    public...
  22. Replies
    2
    Views
    2,272

    Re: Substitution of Values in Array

    You need to loop through the array and check each value. If the value is of x, then change that value to y.

    Here is some pseudo code:


    a = new array()
    for (each element in a) {
    if...
  23. Replies
    11
    Views
    23,617

    Re: Scanner vs BufferedReader?

    It really is up to the professor. When I took CS 1 at college, my professor taught us Scanner. Yet, two semesters later a new professor taught the course with BufferedReader. (However, I believe he...
  24. Replies
    11
    Views
    23,617

    Re: Scanner vs BufferedReader?

    Other than what helloworld said, Scanner internally buffers its input using a CharBuffer. Whereas a BufferedReader is meant for generic use for buffering characters from some sort of input.
  25. Replies
    6
    Views
    1,760

    Re: Parameter's value is never changing

    There is nothing non-sequential about recursion.

    Recursion means that a method calls itself within its own method body. As long as there is a case where the recursion can be stopped, then you will...
Results 1 to 25 of 52
Page 1 of 3 1 2 3