Brandon Tom

Ranch Hand
+ Follow
since Jan 11, 2006
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Brandon Tom

In the book "Head First Design Patterns", the author says that a command object "encapsulates a request by binding together a set of actions on a specific receiver."

This statement is confusing to me. What is meant by "binding together a set of actions?" (After I typed it, I suppose I understood it a little better, but I'd like to hear in from a different perspective).

Thanks!
I don't fully understand volatile. I was hoping that someone could explain it in terms that I can understand.

I sort of need it in the "Volatile for Dummies" way of saying it.
14 years ago
A few people on another forum have suggested that I look into isometric game programming to help me with this design issue. I went out and purchased a very cheap book on the topic and I'm going to peel through it when I get a chance.

If it turns out to be useful, I'll report what I've learned. I've also decided to look at the source code of MegaTek, which is a java version of a board game called Battle Tek.

I've often heard that joining an open source project is often the best way to learn the ropes. The only problem is that it's hard to nail down what it is that I'm trying to learn when, really, I want to learn everything.
14 years ago
I'm developing a board game. Here's what the board looks like:

The 'X' represents a game piece. Pieces can move around the board in three directions:

The directions are indicted by the red, green, and blue lines.

What I'm trying to figure out the best way to design the movement. Basically this is what I was thinking (I said 'was' because it's a TERRIBLE idea): For each direction there are seven rows. I was going to create three classes that represent the three directions and then create objects that represent the rows. There would be 21 rows in all.

Then I'd create a board space object. Each board space is associated to three rows. From there I'd populate the rows with board spaces and that's the general set up.

How valid movement would be determined:

From there all I'd have to do to figure out the movement was valid was to see if the two board spaces (the one being move to and the one being moved from) have a matching axis, then the move is valid.

This tactic looks like it's going to suck. It's totally ineloquent. As you can imagine, there's a lot of duplicate code which is always a sign of disaster (what would Kathy Sierra do?) I need a new strategy and a new inspiration. Where am I going wrong here?
[ March 30, 2006: Message edited by: Brandon Tom ]
14 years ago
Actually, I needed to implement the MouseMotionListener and provide an implementation for mouseMoved (). Thanks anyway!
14 years ago
Say I have a 400 x 400 JPanel in the middle of a 500 x 500 JFrame. The JPanel has string drawn to it that prints out the mouse coordinates. If my mouse were placed exactly in the middle of the JFrame, the string should read (200, 200). What is the best way to accomplish this?

I've used java.awt.MouseInfo but that has only helped me get the position of the mouse relative to the entire screen.
[ March 23, 2006: Message edited by: Brandon Tom ]
14 years ago
When I boot up Tomcat, it gives me this error:

However, I have but one action mapping in my Struts config file and it reads as follows:


It seems to follow the rules. What could be causing the error?
14 years ago
Nevermind, stupid question, I complete forgot about RMI
14 years ago
JSP

By who?



By NetBeans. When you create a new web project it says the source should be set to 1.4 for J2EE 1.4 projects. I don't know why setting it to 1.5 would cause a problem.
14 years ago
JSP
Just out of curiosity. Why is it recommended that we stick with 1.4 when developing JSP? I wrote a class library that makes extensive use of generics, and I was surprised when I had to force Tomcat to compile in 1.5. The question is why did I have to do this?
14 years ago
JSP
I am, in fact, using Access, but really only for learning purposes. All is not lost however, I'm downloading MS SQL Express Server 2005 and the 350 megabyte .NET Framework 2.0 SDK required to run it on right. *twiddles thumbs patiently*

I guess I could always just download MySQL. There's a type 4 JDBC for that right?
Oddly enough, I'm getting an error that's saying that the JDBC-ODBC bridge does not support prepared statements =(
I don't know much about Tomcat. NetBeans comes pre-packaged with it and it handles all the configuration stuff for me. That being said, whenever I test a servlet or JSP in NetBeans, some magic occurs and the page loads how its supposed to load.

I figured that Netbeans was compiling all the data into %CATALINA_HOME%\webapps\TheWebApp, but this isn't the case. NetBeans has Tomcat loading the web app right from the project directory. That's cool and all, but I've deleted one of my test project directories, and now every time Tomcat is started, it gives me an error message saying that the resource (the project that is long gone) it's not where it's supposed to be.

I need Tomcat to stop looking for that webapp. What files and configurations do I need to change in order to make that happen?
14 years ago
Cool. The book I have is just getting to prepared statements.
So here's the code:



It compiles fine, but when I try to run it, an exception is thrown.



I'm REALLY new with JDBC, so I have no idea what this "Too few parameters" deal is all about.

Thanks!