I'm experiencing performance slow down on JBoss 7.1.1 Final. I wrote simple program that demostrates this behavior. I generate an array of 100,000 of random integers and run bubble sort on it.
@Model
public class PerformanceTest {
public void proceed() {
long now = System.currentTimeMillis();
int[] arr…
The A* algorithm is used by enemies to have a path to the goal. It's working but when sometimes I placed a tower in a grid (randomly) it produces a stack overflow error. The A* algorithm would iterate the enemy and find its path and pass the list to the enemy's path.
I added debug logs and the list that I'm getting it looks like it would arrive…
I have written some code to preform 3D picking that for some reason dosn't work entirely correct! (Im using LWJGL just so you know.)
I posted this at stackoverflow at first but after researching some more in to my problem i found this neat site and tought that you guys might be more qualified to answer this question.
This is how the code…
I am getting a null pointer excecption to both my sprite and level. I am working on my mob class, and when I try to move him and the move function is called, the game crashes after checking collision with a null pointer excecption. Taking out the one line that actually checks if the tile located in front of it fixes the problem.
Also, if i…
I know the answer: "we need rules to prevent shooting into your own foot". Ok, I make millions of programming mistakes every day. To be prevented, we need one simple rule: prohibit all JLS and do not use Java. If we explain everything by "not shooting your foot", this is reasonable. But there is not much reason is such reason.
When I…
I have to develop a whiteboard application in which both the local user and the remote user should be able to draw simultaneously, is this possible? If possible then any logic?
I have already developed a code but in which i am not able to do this, when the remote user starts drawing the shape which i am drawing is being replaced by…
Hi, I have a school assignment, to send a jpg image,split it into groups of 100 bytes, corrupt it, use a CRC check to locate the errors and re-transmit until it eventually is built back into its original form.
It's practically ready, however when I check out the new images, they appear with errors..
I would really appreciate if…
Here is my code:
import java.net.*;
import java.io.*;
import java.util.*;
import org.jibble.pircbot.*;
public class WebSocket
{
public static int port = 12345;
public static ArrayList<WebSocketClient> clients = new ArrayList<WebSocketClient>();
public static ArrayList<Boolean> handshakes = new…
I am trying to use clone but the original object is also changed when values of cloned object are changed.
As you can see KalaGameState does not use any objects so a shallow copy should work.
/**
* This class represents the current state of a Kala game, including
* which player's turn it is along with the…
Hello i have another problem with RichFaces
this is my application and it shows how i want it to work :
http://www.screencast.com/users/Schyzotrop/folders/Jing/media/a299dc1e-7a10-440e-8c39-96b1ec6e85a4
this is video of some glitch that i can't solve
http://screencast.com/t/MDFiMGMzY
the problem is that when i am trying to…
I'm trying to get Eclipse to compile and run a HelloWorld class but it can't even do that. I have installed Eclipse x86 SDK 4.2.0 together bit with the latest JRE and JDK both in 64 bit as well. I also have the PATH variables set to respond to command prompts. When I try to run the following code:
class HelloWorld {
…
this code below will throw :
Exception in thread "main" java.sql.SQLException: Unable to connect to any hosts due to exception: java.lang.ArrayIndexOutOfBoundsException: 40
mysql 5.1, jdbc driver 5.1.21
if I change connection string to any database have name's lengh != 9, it will pass to print 'connected'. or I…
Hi,
I'm not an expert in writing shell scripts but also I'm looking for a very specific solution.
OS: CentOS release 5.2 (Final)
I've a Java standalone which keeps writing (all System.out.println) to a log file. For some unknown reason, this Java standalone stops working at some point of time in my server and…
Here is the code:
package localhost
import scala.tools.nsc.reporters._
import scala.tools.nsc.util.Position
class MyReporter extends Reporter {
/** <p>
* Give message of an rejected program
* </p>
*/
def info0(pos: Position, msg: String, severity: Severity, force: Boolean) = {
…
I run the following code in Eclipse IDE:
public class HelloWorld {
public static void main(String[] args)
{
System.out.println("Hello World!" ) ;
}
}
And it renders the expected output.
When getting into the command prompt (DOS) already in the directory, I type this
javac HelloWorld.java
…
When I print out the path in bash, it prints this:
/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin
When I run System.out.println(System.getenv("PATH")); in Java running under Eclipse, it prints
/usr/bin:/bin:/usr/sbin:/sbin
How can I figure out why there is this discrepancy? I need to add…
Currently the urls generated by the jobtracker & namenode return either hostnames like bubbles.local or just bubbles. These end up not resolving unless the client machine has specified these in their /etc/hosts file.
When I run the hostname command on these machines it returns a hostname complete…
Hi,
I'm using apache axis to connect to my sugar crm instance. When I'm trying to connect to the instance it is throwing the following exception
Exception in thread "main" AxisFault
faultCode: {http://xml.apache.org/axis/}HTTP
faultSubcode:
faultString: (401)Authorization Required
…
Hi!
I've just found a great sample of Facebook Connect on Blackberry by Eki Y. Baskoro,
The following is a short HOWTO on using Facebook Connect on Blackberry. I created a simple Facade encapsulating the Facebook REST API as well as added 'rough' MVC approach for screen navigation. I have…
This code works perfectly in Ubuntu, in Windows and MacOSX, it also works fine with a Nexus-One currently running firmware 2.1.1.
I start sending and listening multicast datagrams, and all the computers and the Nexus-One will see each other perfectly. Then I run the same code on a Droid…
I am trying to get the Highlighter class from Lucene to work properly with tokens coming from Solr's WordDelimiterFilter. It works 90% of the time, but if the matching text contains a ',' such as "1,500" the output is incorrect:
Expected: 'test 1,500 this'
Observed: 'test…
I have an application which updates a variable about between 5 to 50 times a second and I am looking for some way of drawing a continuous XY plot of this change in real-time.
Though JFreeChart is not recommended for such a high update rate, many users still say that it works for…