Jump to content

  • Log In with Google      Sign In   
  • Create Account


Belgium

Member Since 13 Jun 2007
Offline Last Active Feb 28 2013 03:56 PM
-----

Posts I've Made

In Topic: Java: Cannot find symbol error

16 January 2013 - 02:53 PM

Thanks, LorenzoGatti.  I didn't quite understand what you were referring to and am still too ignorant to know if you were telling me the answer but you did send me down a path of investigation which resulted in a fix.

 

Anyways, I have made the problem go away.  I believe the problem is related to the build order of the jar files.  When I put "common.jar" at the top of the compile list the problem goes away.

 

My ignorant theory:

 

common.jar is used in many other jar files.  Many of those other jar files are also included in the problem file, "detroit.jar".  When I make a change to common.jar it isn't being seen by detroit.jar because an earlier .jar file has already been compiled which includes the non-editted version of the classes in common.jar.  It's this old version of the classes in common.jar that are being seen by detroit.jar.  The class is there but the new method is not.  New classes and methods are seen but new methods of previously existing classes are not. 

 

Odd thing is, after moving common.jar to the top of the compile list, compiling successfully, then moving common.jar to the bottom of the compile list, it still compiles fine so there's some understanding I still don't have here.  I can duplicate and resolve the problem at will at this point by adding new methods.

 

So, other than ensuring common.jar is always at the top of the compile list, is there a better way of avoiding this problem? 


In Topic: Parsing String sometimes doesn't work.

23 March 2012 - 08:48 AM

The null character is not considered whitespace in Java. You'll either have to adjust your regex to "[\0\\s]+", or clean up your input data files (if you have that option).


Thanks! I changed it to "[\\s\\x00]+" and that seems to work.

In Topic: Program keeps crashing

27 February 2012 - 04:31 PM

Are you sure it's crashing? Maybe the console window is closing after the program has finished? It doesn't crash for me when I run it from a command line. What happens if you add some code to have the user 'press any key' before exitting the program?

Additionally, why is i += 5 in the following loop? Is the number I am requested to enter supposed to equal the number of enemies? When I enter '2' or '3' I am only ever asked to enter one enemy type.

for(int i = 0; i < number; i += 5)
{
theBattleField.AddEnemy();
}

In Topic: One source file used in multiple projects?

20 January 2012 - 04:14 PM

stick it in a jar.


Thanks. That does the trick.

In Topic: c++ Infinate loop help

20 October 2011 - 09:12 AM

Once the do loop is entered the user is never again asked for an answer. So, since the do loop continues until the correct answer is given and the user is only once allowed to provide one...

Also, I'm a little confused by this game. Why is randnumber initialized/used twice? It is initialized before the do loop then another randnumber is initialized upon entering the do loop. The randnumber within the do loop would seem to be creating a moving target for the user, if the user were allowed to guess. This seems somewhat different than the typical version of this game.

PARTNERS