homework

Help needed in Multithreading to determing which thread stops first

Write a class named RaceHorse that extends Thread. Each RaceHorse has a name and run() method that displays the name 5000 times. Write a Java application that instantiates 2 RaceHorse objects. The last RaceHorse to finish is the loser. This is the question. I have written the code for the two classes two run the thread Here are the code...

How to Edit an Arraylist that is already placed in a Listbox? And divide each item of the arraylist into individual textboxes?

Well it looks something like this _http://i29.tinypic.com/ib9oiu.jpg I had already posted a question on how to put an arraylist inside a listbox but that's already solved. http://picasaweb.google.se/109674614304504038591/Desktop?feat=directlink There is all my code, so I need to be able to edit the selected customer, clicking on custom...

Java & Data Structures: Can someone discuss theses data structures one by one for this question?

Which Java collection class can be used to maintain the entries in the order in which they were last accessed? Choose one answer. a. java.util.HashSet b. java.util.LinkedHashMap c. java.util.Hashtable d. java.util.Vector e. None of these ...

How to write a Movie Booking application codes for netbeans

Design a Movie Booking application that Allows user to browse movie listing (of at least 10 movies) with image and description; When user selects a movie, show him the seats available; User may choose the seats by clicking on them; User may de-select a seat by clicking on a selected seat; When user clicks a “Book” button, display his b...

built predicate into prolog

input = * value = 3 output = ***(3 star) use prolog to write out the coding when key in value is 3 than the output is ***(3star) or when key in value is 5 than output is *****(5 star). so i want to ask what are the coding in prolog for this question. my answer is like below but cannot compile and have error. can check for me?? start...

how to write binary search program in c

how to write binary search program in c using recurssion ...

How do i create a Identity starting with a Letter first then numbers after?

I want to create data that contains info about my supplier making it auto generate his ID. for e.g: SupplierID i want it to appear as - SID001, SID002 all to auto genrate after each other. How do i do this with SQL? Please let me know thanks! ...

Recursive (pedigree) tree building from (child, parent) list in Python

Hi All, I have as input a list of tuples (child, parent). Given that a child only have one parent. I would like for every child to build an ordered ancestors list. Any tip ? input would be like : [('3', '4'), ('1', '2'), ('2', '3')] output would be like: 1, [2, 3, 4] 2, [3, 4] 3, [4] 4, [None] ...

MySQL - How can I get names of all students that were taught by teacher with name John?

How can I get all students names that were taught by the teacher with name John? student id name student_has_teacher teacher_id student_id teacher id name ...

Regex that defines a regular language with {a,b} without a substring with exactly 3 b's (bbb)

Pretty much what the question says. I came up with (ba)?(a + bb + bbbbb + aba)*(ab)? Is there anything more readable? Or is this incorrect? I know you shouldn't really be doing this sorta thing with Regex when you can just go !~/bbb/ in your code, but it's a theory exercise. Thanks. Edit for Clarification: I'm not using | to repre...

Alligned memory allocation

I have the following assignment: Write a function in C that allocates block of memory and returns a pointer to the start of the memory under these conditions: All addresses in the block are divisible by 32 Allocated at least the number of the bytes required Every cell in the block is initialized to zero No global varia...

Store data file in Image

Can anyone tell me how to store a data file in image file...?? like filename.txt in filename.jpg I require only a single line code..bt whts the code ??? ...

while loop!!! C programing

Write a program that contains the loop while (scanf("%1f", &salary) == 1) {.......} within the body of the loop compute a 17% federal withholding tax and a 3% state withholding tax and print these values along with the corresponding salary. Accumulate the sums of all salaries and taxes printed. Print these sums after the program exits...

Fibonacci sequence

Possible Duplicate: How to write the Fibonacci Sequence in Python Hi. I'm also a learning programmer and I've been asked the same question you were asked for Fibonacci numbers and I can't figure it out. Can you please show me the code you used to generate these numbers asking the user to give numbers and find only the numbers ...

Print Palindrome in Java

I have the following code and i want to print the palindrome on console. Please let me know what should come inside the if condition so that it can print all palindrome in between 0 to 10000. The palindrome is 161, 1221, 4554, etc.... Java code: int palindrome[]; palindrome = new int[10000]; for (int count = 0; count < palindrome.len...

What equivalent in MIDP programing to the JButton of swing-application?

In swing(GUI) application I used JButtons. Now I need the same application in MIDP and I'm conuse... I need Idea for what to use with and an example of how to use it and what kind of listener might possible fits.(Because I need to refresh the shown screen after every click on a button) And one more question: I use Netbins with the s...

java.net.SocketException: Unrecognized Windows Sockets error: 0: JVM_Bind

What does this error mean? java.net.SocketException: Unrecognized Windows Sockets error: 0: JVM_Bind My assignment is to create a client-side app that will exchange info w/ the server class that was supplied. We're supposed to use localhost. Here is the Server class... import java.io.File; import java.io.FilenameFilter; import java.i...

Any Java Tree API which can be used to find distance between 2 terms

Hi friends My requirement is 1) I should construct a tree like the one which is given below in the figure. 2) I need to then compute the distance between two terms say C and D. or D and F. ( as per the figure A and B are categories C,D,E and F are terms under the respective categories. Expected results : Search Terms ---------- Di...

Shall I specify setter or not?

Here is an initial specification for a simple Address class. This is a simplification as it ignores complications such as apartments in the same building potentially having the same ‘number’, e.g. 29a, 29b. class Address { private: int number; string name; string postcode; public: //getters implemented ...

database design normalization help needed (5nf)

Can you guys show me how to get this ERD in 5th normal form? We did a class assignment yesterday where we had a real client come in and explain to us his need my group came up with this model I am trying to take it a step further and see if I can get it to 5th normal form so that I can understand it better as next week we will be doing a...