Archive for October, 2009

How would i move multiple objects at the same time in java using a for statement?

October 31, 2009 - 9:17 pm 2 Comments

Ok its a really simple assignment. ive had to make an image comprising of three shapes, Circle,Square,Triangle. i decided to make a boat which floats across the page left to right and then from right to left.
the boat is comprised of 4 separate Squares which are all different objects, and a triangle.
when i run the code the objects take it in turn to move, however i want them all to move together. so all of the shapes that make the boat move in sync.
Hope thats a bit more clear?

I don’t understand. "Move" an object? Can you explain more please. The for construct simply indicates the the code inside its braces with repeat x amount of times. e.g.

for(int x = 0; x < 10; x++){ System.out.println("*");}

x controls how many times the code inside the braces will run.

I saw your last question. You’ve still failed to go to into detail. What is the nature of the assignment? Post some more information, instead of asking vague inquiries. Good luck.

See Rectangle2D for geometric objects. Also, the Graphics2D for the draw(Shape s) method. You’ll also need to know how to use Threads and some simple swing concepts. It would take a miracle to teach you what’s needed online. I suggest you check out Sun’s tutorials for Java programming. They’ve got everything you need, plus example using Swing and Threads.

important methods:

Rectangle2D.setFrame(double d1, double d2, …, ….)
Graphics2D.setColor(Color c);
Graphics2D.draw(Shape s);

Simple example:

class Example {
public static void main(String… args) {
Rectangle2D[] shapes = new Rectangle2D[5];
Canvas c = new Canvas(shapes);
JFrame f = new JFrame().add(c);
//set size and set visible here
new drawThread(c);
}
}

class Canvas extends JPanel {
Canvas(Rectangle2D[] shapes){super();
//set Frame for all shapes
}
//override paintComponent(); required of all swing apps
public void paintComponent(Graphics g) {
Graphics2D g2d = (Graphics2D)g;
g2d.setColor(Color.RED);
for(Rectangle2D r : shapes) {g2d.draw(r);}
}
}
class drawThread extends Thread {
drawThread(JPanel canvas){ super(); this.start(); }
public void run() {
while(true) {
//change the frame of the geometric objects, move it
try{Thread.sleep(5000);}catch(Exception){}
canvas.repaint(); //calls paintComponent() on JPanel
}
}
}

That’s about half your project. Get crackin’ baby….

How do I create a join SQL statement?

October 31, 2009 - 9:17 pm 2 Comments

I need to provide a join sql statement that returns a store ID, store name, manager employee first and last name fields, manager employee grade, the city and state fields.

..i’m not sure of this.. you’re joining 2 or more tables in here?

and.. what’s you’re application? where will you use it? access?

what are the fields in the table1, and what are the fields in table2 … that you’ll want to join…

if i have these tables with their fields (e.g.)

Table name: Weather table
Fields: City, Temperature, Date

Table name: State table
Fields: State, City

SELECT Weather.City, Weather.Temperature, Weather.Date, State.State
FROM Weather INNER JOIN State
ON Weather.City = State.City

the result:

Table name: Weather
Fields: City, Temperature, Date, State

…don’t know if this can help you….

Select whether the following statement is always true, sometimes true, or never true?

October 31, 2009 - 9:17 pm 4 Comments

The hypothesis of a statement is the if part.

A. Always
B. Sometimes
C. Never

B

do uc’s have their own records of past personal statements? or do they just delete them every year?

October 31, 2009 - 9:17 pm 1 Comment


collegefinder.hotusa.org - try this site. It has resume for this UCs admission process, tips to apply and grades requirements.

Using SQL to update a record is adding to the field not replacing what’s in the field?

October 31, 2009 - 9:16 pm 5 Comments

Need to update a record with the statement "strEdit = "UPDATE joborder SET Order_Status = ‘" & updOrder_Status & "’ WHERE Order_Id = ‘" & updOrder_Id & "’". Instead of replacing the value in Order_Status it keeps adding to the current value. For example, the status value is open, and when i try to update it the value becomes "open, closed". By the way, I’m using a drop down box to select order status.

if updOrder_Status is the name of your drop down, you need to get the SelectedValue, not just the entire object; if you call the entire object, as it appears you are doing here, ALL values in the drop-down (which is handled by VB as a string array) will be inserted, after being converted to a comma-delimited string.

That’s almost certainly the problem you’re facing.

This may work better:

strEdit = "UPDATE joborder SET Order_Status = ‘" & updOrder_Status.SelectedValue & "’ WHERE Order_Id = ‘" & updOrder_Id & "’

How should an opening statement in a murder trial start and give an example?

October 31, 2009 - 9:16 pm 3 Comments

I need to write a three minute opening statement for prosecutor or defense. How should it be worded and give an example (like write a little opening statement). Ten points guaranteed to best answer!!!

In a case of a police officer killing an innocent person.

People of the court. What you see here today is pure sickness. Pure disgust and utmost disrespect for civilization. This hero blue boy decides after arresting an innocent person that he would murder him in cold blood.

Have you met or heard of someone who has developed a mission statement?

October 31, 2009 - 9:16 pm 2 Comments

Have you met or heard of someone who has developed a mission statement?
What has he/she accomplished after having developed it??

My buddy Woddy S has one. He developed his after reading Steven Covey’s book "The 7 habits of highly effective people". He has a great life and wonderful family and is pretty successful manager in the U.S. Army now. Gotta hand it to him, He is a role model of mine.

What are the most imporant things to look at in financial statements?

October 31, 2009 - 9:16 pm 4 Comments

There are so many different ratios and trends you can look at in financial statements. Plus a lot of these seem to require assumptions about things like interest rates that are just impossible to know.

If you were comparing several stocks in a like gaming, what fundamental factors would lead you to one stock over another?

Other than the balance sheet and income statement, I would look at the P/E ratio. A P/E ratio being high (or low) doesn’t say anything unless you compare it with other companies in the same industry. Say Microsoft had a PE ratio of 30 and Apple had a PE ratio of 95. On that alone you would say that the price-to-earnings ratio of 95 is greater than Microsoft since they are primarily in the same market and investors are expecting ‘higher returns’ with Apple than Microsoft ( a good sign to buy the stock).

I have too many old statements in my "My Status" window. How can I delete them?

October 29, 2009 - 2:09 pm 5 Comments


Ya can’t, ya have to add to them till they ‘fall’ off.. LOL

Is this statement accurate about America and the League of nations?

October 29, 2009 - 2:09 pm 3 Comments

If America had joined the League of nations, history would have been different because perhaps it would have joined world war II sooner in an attempt to keep peace seeing as Germany was not allowed in the League in the first place. [ I don’t now how to answer how history would have been different if it had joined. I would appreciate some help. Not asking to answer it for me. I just need to be put on the right track thank you.

League of nations was only stepping stone for world government that the elite were working for (WWI was waged mostly to establish the League of nations)but after it failed, WWII was waged and finally the U.N was established and ever since the elite have been getting closer to world government.