User Profile

Collapse

Profile Sidebar

Collapse
vipersniper5
vipersniper5
Last Activity: Feb 27 '08, 05:08 AM
Joined: Dec 9 '07
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • vipersniper5
    replied to jvm memory leak
    in Java
    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...
    See more | Go to post

    Leave a comment:


  • vipersniper5
    replied to strange typecast problem
    in Java
    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!
    See more | Go to post

    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!
    See more | Go to post

    Leave a comment:


  • vipersniper5
    replied to illegal start of type expression error
    in Java
    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.
    See more | Go to post

    Leave a comment:


  • vipersniper5
    replied to Negative Zero Help
    in Java
    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...
    See more | Go to post

    Leave a comment:


  • vipersniper5
    replied to strange typecast problem
    in Java
    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...
    See more | Go to post

    Leave a comment:


  • vipersniper5
    replied to strange typecast problem
    in Java
    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; 
        
        private
    ...
    See more | Go to post

    Leave a comment:


  • vipersniper5
    replied to Strange DataOutputStream file.
    in Java
    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...
    See more | Go to post

    Leave a comment:


  • vipersniper5
    started a topic strange typecast problem
    in Java

    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:...
    See more | Go to post
No activity results to display
Show More
Working...