Search:

Type: Posts; User: bondage

Page 1 of 2 1 2

Search: Search took 0.10 seconds.

  1. Replies
    9
    Views
    10,672

    Re: Bubblesort of an ArrayList with objects

    KevinWorkman,

    thanks for your quick replies.

    Yes i read it and i went throuh the examples in USING JAVA COLLECTIONS and Lesson: Algorithms (The Java™ Tutorials > Collections) however i am still...
  2. Replies
    9
    Views
    10,672

    Re: Bubblesort of an ArrayList with objects

    Thanks,

    I tried to implement something like this in the sort class


    public static void SortCustomers(ArrayList<Customer> customerList)
    {

    Comparator comparator = Collections.sort(arg0);...
  3. Replies
    9
    Views
    10,672

    Re: Bubblesort of an ArrayList with objects

    KevinWorkman,

    thanks for the link.

    I understand that there are two methods that may be relevant in this case, namely sort(List<T> list) and sort(List<T> list, Comparator<? super T> c).

    I do...
  4. Replies
    9
    Views
    10,672

    Re: Bubblesort of an ArrayList with objects

    what's that? Do you know of an example please?
  5. Replies
    9
    Views
    10,672

    Bubblesort of an ArrayList with objects

    Hi,

    I have an arraylist containing customer objects with the following attributes and methods:


    import java.io.Serializable;
    public class Customer implements Serializable{

    private...
  6. Re: calling a changing variable from another class

    yes but how do i concretely create an instance of main into resources, say from the exmaple i have posted in the first post of this thread?
  7. Re: calling a changing variable from another class

    But do you mean i create an instance of main in resources? i.e.
  8. Re: calling a changing variable from another class

    One final (maybe absurd) question. How do i pass the instance of Main into the Resources class?
  9. Re: calling a changing variable from another class

    Thanks for the reply.

    Unfortunatley am bound to work with some code that i have not used and cannot change everything. Would it be possible to implement a method in the resources class that...
  10. Re: calling a changing variable from another class

    KevinWorkman,

    thanks for your reply.

    Basically i have a main class that i use to print stuff that is changing in other classes. In one class, i have an interation that as time changes, one...
  11. calling a changing variable from another class

    I have redrafted the problem so as to be conceptually simpler.

    I have two calsses, a main class and resources class.

    MAIN CLASS

    public class Main {

    private static Resources resource =...
  12. Replies
    5
    Views
    2,823

    Re: normal distribution random number algorithm

    Hi,

    the algorithm for the von-neumann acceptance-rejectiom method is as follows:
    1. generate a random number u between 0 and 180 (from the x-axis)

    2. generate a random number v between 0 and 7...
  13. Replies
    5
    Views
    2,823

    Re: normal distribution random number algorithm

    hi,

    Would it be possible to have some assistance on the way forward to develop a random number using the von-neumann's acceptance -rejection method for the distribution in the image above? I am...
  14. Replies
    5
    Views
    2,823

    normal distribution random number algorithm

    Hi,

    I need to develop a method that basically returns a random number based on specific parameters as defined below.

    The context is that this method wil go in a wider implementation of a...
  15. Replies
    5
    Views
    3,638

    Re: UPDATE SQL QUERY by getting user variables

    Hi,

    so would something like this work:

    UPDATE individuals SET balance=balance+ jTextField1.getText() WHERE ID='1'; ?

    Also, will this automatically return the Balance from the database and...
  16. Replies
    5
    Views
    3,638

    Re: UPDATE SQL QUERY by getting user variables

    Thanks for your reply.

    However, how can i get the user data (from a text field) and pass it in the SQL statement. How can i do this? Are you aware of any possible tutorial online or any other...
  17. Replies
    5
    Views
    3,638

    UPDATE SQL QUERY by getting user variables

    Hi,

    I have a table called 'individuals'. It has 5 entities i.e. ID (int,) name (String), surname (String), Age (Int) and currencyBalance(double). These are stored in a mySql Database.

    I would...
  18. Re: Creating subsequent frames in java with Jframe

    KevinWorkman,

    Thanks for your reply. this will surely be helpful, but what I am after is something like when you are installing an application, and you get NEXT and then another screen pops up...
  19. Creating subsequent frames in java with Jframe

    Hi,

    I am making a small application. I want the first frame to be a sort of username / password login. When the user presses ok, and if the username and password are correct, then the next screen...
  20. Thread: Moving average

    by bondage
    Replies
    0
    Views
    3,762

    Moving average

    Hi,

    i have the attached text output from a java program.

    I need to implement a 5 point moving average filter (i.e. if there are 500 values, take the values 1to 5 and make the averge, then take...
  21. Thread: Java sound API

    by bondage
    Replies
    3
    Views
    2,880

    Java sound API

    Anyone got information on how to use the java sound API?
  22. Replies
    10
    Views
    3,597

    Re: outputing to a text file from sound API

    and how do i do that? I do not suppose i use filewriter right?
  23. Replies
    10
    Views
    3,597

    Re: outputing to a text file from sound API

    Hi,

    I have tried the code that you provided, however i am only getting the following output:

    ????????????

    Would it be possible to have the software to read the tempBuffer[] array and...
  24. Replies
    10
    Views
    3,597

    Re: outputing to a text file from sound API

    Many many thanks for your reply! I really appreciate tou took time to reply to me.

    One final question if i may.

    When you say "Whatever string you want here" in the post below...
  25. Replies
    10
    Views
    3,597

    Re: outputing to a text file from sound API

    Hi,

    from research i have done, the best thing is to use filewriter to output as integer to a text file (maybe using a for next loop) that cathes the audio data bytes in the ByteArrayOutputStream...
Results 1 to 25 of 30
Page 1 of 2 1 2