User Profile
Collapse
-
How are you connecting to java from C++? JNI?The garbage collector will collect garbage when there is no longer a pointer to that object in your program. Check to make sure you are not retaining references anywhere (such as Vectors, Arrays, ect). Also if you are using JNI, as I understand it anything used in JNI call will not be dealt with by the garbage collector, and must be freed in C, I could be wrong on the specifics of this, but nothing allocated... -
Well sure enough you were right, at least you gave me the clue I needed. I was able to the code for the main part of the game, and each bot in the game is loaded by the same class of ClassLoader, but a different instantiation.
Thank you again for the help!Leave a comment:
-
for using MySQL with java I reccomend this link:
http://java.sun.com/docs/books/tutorial/jdbc/basics/index.html
the needed driver with instructions on installing can be found at:
http://dev.mysql.com/downloads/
As for how to store the Audio file, that would have to do with MySQL specifically, and I don't know but it shouldn't be too hard to find a reference site.
Good luck!Leave a comment:
-
could you post again using the CODE tags? simply put I'm not going to try reading that without indentation. Also, without some kind of info as to the error your getting or the problem thats occurring there little hope of finding the bug in code that long.Leave a comment:
-
I'm pretty sure the problem here is that the number your working with is not actually 0, but rather a decimal >-.1 for example -.001, the negative comes in because it is a negative number, but with the format specifiers your ignoring those extra digits. for a nice easy fix I would suggest something like:
if(y2>-.1&&y2<0)
y2=0;
before your print. There are other ways (rounding/truncation) but thats nice...Leave a comment:
-
thats why I'm so confused, is that I know I should be able to cast to itself, and that error says pretty clearly I've got the right object of the right type. I tried recompiling everything I have source for (basically whoops2 and ClobberBot) with no success. Unfortunately everything else I only have the class files and documentation for. I think I may need to break down and use reflection (I was able to get that to work, but I hate too since it...Leave a comment:
-
well you asked for it :-P code, leaving out irrelevant functions is
...Code:import java.awt.geom.*; import java.awt.*; import java.util.*; //import java.lang.reflect.*; public class whoops2 extends ClobberBot { private static final int BULLET_RANGE = 40; //40!!! private static final int BOT_RANGE = 40; private static final int BOT_WINDOW = 80; privateLeave a comment:
-
First as to the source of you problem:
http://java.sun.com/j2se/1.4.2/docs/api/java/io/DataInputStream .html
the readline method had been deprecated specifically because of it does properly read in characters written by an DataOutputStrea m(this is news to me, but then I've never used one). The link provided also provides the solution of using the buffered readline method as follows:
Programs that use the DataInputStream...Leave a comment:
-
strange typecast problem
I am trying to typecast and object to get at methods specific to its class, but am running into a strange error at runtime.
The line that causes the problem is simply:
whoops2 temp=(whoops2 ) teammate;
where teammate is declared as class which whoops2 extends, and is actually a whoops2 object. The error I'm receiving is:
java.lang.Class CastException: whoops2 cannot be cast to whoops2
java.lang.Class CastException:...
No activity results to display
Show More
Leave a comment: