Hi, I wrote the following code for Miller Rabin algorithm:public static void main(String[] args){MillerRabin test = new MillerRabin();test.test_prime(221,5,2,55);}public void test_prime(int n, int a, int k, int q){if( (int)(Math.pow(a,q)) % n == 1 ...
449 byte By
ravengaa at 2007-11-27 3:22:14
Hello all,I have an array of characters and I want all possible permutations of it. I have seen some threads in forums but i couldn't find the exact one.For example char ch[]={'a','b','c'};Output should ...
i hav one applet which creates an instance of another and uses it. it seems to work fine as long as i dont call the paint method for my second applet in my first applet, but i hav not done much, and dont wanna waste my time. is this reasonable, or will it eventually lead to errors?
All:I have an open source neural network program ( http://www.simbrain.net/) which involves multiple neural networks (simulated brain circuits) talking to multiple environments. In principle the networks and environments should also be able to talk to each other.However, as the program has grown ...
let me know if dao pattern is the best followed in all almost all the projects though finding alternatives to it. please clarify this for me and also i do want to know the best practices of the industry in using design patterns.
3228 byte By
Hanz_05a at 2007-11-27 3:28:33
Hi, I am trying to work out how to use the keylistener to make a character move in the tiled map........(both the java files compile fine but the keylistener is not working)This is my code for GFrame.java that is calling the GMap.java...import java.awt.*;import javax.swing.*;import ...
I am trying to rebuild a tree from its preorder traversal (A (B (C) ()) (E )) where each (X) is a nodeI have this (A (B (C) ()) (E )) as a string.I was thinking of implementing this with a Stack but It looks like it is hard process. the other approach is to access each character with the ...
i hav an applet which uses an instance of a class which is in the same .java file. if i run a method on the class then the keyListener ceases to work. i hav run joptionpanes at the end of my paint and it gets through to the end of my paint method, but it seems never to repaint at all. (mayb ...
Hi,I am a junior programmer and I am trying to understand somewhat more about best practices and design patterns.I am looking for more information regarding the DAO pattern, not the easy examples you find everywhere on the internet, but actual implementations of real world examples.Questions:1) ...
I need to rewrite the SQL Server's function STDEVP in Java. I did the normal standarddeviation (STDEV) as it is widely described on the net:/*** Get the standard deviation of a list of numbers.* * @param numbers List of numbers.* @return Standard deviation of ...
704 byte By
Siva_VSa at 2007-11-27 3:36:03
Hi,I am new to java and working on a project which needs to list files from Windows O/S by FIFO sequence. Here is the scenario,One of the application logs/stores files in Windows System. After that files has to be moved to another files system on AS/400 by FIFO sequence.I need to write java ...
I am trying to rebuild a tree from its preorder traversal(A (B (C) ()) (E )) where each (X) is a nodeI have this (A (B (C) ()) (E )) as a string.here is what I did .Build generic BinTree with Data as charcter and left and right treeand each tree is built recursively .It seem to me logically ...
255 byte By
Astrofa at 2007-11-27 3:38:28
Hey, I was just wondering, whats the "best" 3D java library? ive heard of java3D, jogl, JMonkeyEngine, Xith, etc etc, but which one is easy to learn? Im used to swing programming so i wud prefer something that is similar to Swing stuff. thx!
445 byte By
Hanz_05a at 2007-11-27 3:41:42
HELP!!!!! I am creating a tile map of size 32*32. And the character image size is also 32*32. Now i am stuck in making collision with the walls. I have tried my own method but to no avail. Has anyone tried to doing collision detection? Need a simple logic method to detect the collision... ...
50 byte By
Hanz_05a at 2007-11-27 3:41:59
I didn't noe it was forbidden........Sorry
Hi,I wasn't sure where to go for this, there doesn't seem to be a "support forum" or any easy way to reach the forum administrators without starting from the top at Sun.I don't know why my screen name is my name, but I was wondering if there's a way to change it. I have tried the Forum ...
1084 byte By
J.D.a at 2007-11-27 3:51:13
Hello everyone,I have a key listener that looks like thispublic void keyPressed(KeyEvent e) { int key = e.getKeyCode();if (key == KeyEvent.VK_UP) t.keyUp();if (key == KeyEvent.VK_DOWN) t.keyDown();if (key == KeyEvent.VK_LEFT) t.keyLeft();if (key == KeyEvent.VK_RIGHT) t.keyRight();if (key == ...
hello all, I am looking for a non linear regression algorithm to find constants (a,b,c,d) for my function Y=Exp^(a*x+b)+Exp^(c*x+d)Where Y and X i already have the dataUsing non linear regression i need to find the constants which would be the best guessesCould some body provide some ...
hello all, I am looking for a non linear regression algorithm to find constants (a,b,c,d) for my function Y=Exp^(a*x+b)+Exp^(c*x+d)Where Y and X i have the dataUsing non linear regression i need to find the constants which would be the best guessesCould some body provide some informations. ...
Hi all! It's time for my next problem ;) And before I post it, i would just like to thank everyone in this forum for all the help I've gotten from you guys.Anyways, I'm trying to reconstruct a shape from an unordered set of points. My goal is to do a (least squares) fit with a beizer spline, ...
i need an idea for a collision checker.the picture i want to collide is a plane and it is being hit by a bullet. but right now the picture is a box and so its really unrealistic. thx
2461 byte By
jaredpa at 2007-11-27 4:19:34
I need display multiple fields from a DTO throughout the presentation layer. What is the best way to format display data without duplicating the logic throughout presentation layer?ExampleI have a Person DTO that has first name, last name, and suffix 'getters' and am constantly showing the ...
718 byte By
Meirya at 2007-11-27 4:23:15
hi all i need to develop application that started as smell one but now become bigger the options and conditions it has to handle also are variedso im looking for more generic way to build it .here is the high level requirements :this process will act as a server that will listen for requests ...
Hi, I am working on a project to create a pinball game using Java. I have been told to use JSlider to create the spring where the ball fires off from and I am struggling with this part as I haven't used JSlider properly before. Can someone offer any help,Thanks
Hello, I am currently working on a port of the Falldown game, if you don't know what it is you can search for a flash version on the internet.For those who know what I am talking I need help implementing the random platforms that scroll vertically on the screen. I have been thinking to either ...
I have if(engine.pPressed && !pauseGame){pauseGame = true;countergamePause = 10;}if(pauseGame){if(engine.pPressed){pauseGame = false;}return;}But that only pauses the game if i hold down the p button. ANy clues why? anyways to pause ...
I'm trying to verify that I'm using lightweight components/containers.I see that my container's peer is sun.awt.NullComponentPeer.Does that mean that it's a lightweight component?Thanks.
:(
I have always been fascinated in how a pinball sim works and have always wondered about the algorithm(s) that enable the realistic bouncy movements of a falling pinball.If I am able to wrap my mind around it then I may attempt a simple pinball game using Java.If anybody has attempted this in ...
Here is a code fragment of my Falldown game, the problem is that the KeyEvent does not trigger the ability to change the value of the x_pos of the ball. I used debug statements and verified they were working but for some reason it doesnt change the animation:public class PaintBall extends ...
Hello folks,I'm trying to figure out how to wire the models and views I have.I have three models that represent three separate applications, that are combined into one shell application. Each model has its own view(s). Easy enough.One view has yet another micro-application nested within ...
my friend and i uploaded a game to the internet at the following URL: http://www.geocities.com/chrisbert91/we are by no means done with the game. we are far off. we want input on the game and how we can make it better. we are also having a problem. the images are rather slow to load and we need ...
I have been looking through animation examples and am interested to find two methods of creating a simple animation. One way is shown to use Timers to schedule a repaint call, the other is to create a new thread and use that to repaint the JFrame over so many milliseconds. I have seen the use ...
887 byte By
CBya at 2007-11-27 5:06:10
A Builder knows how to construct the various parts of an aggregate, while a Director knows the order in which they should be constructed. Wikipedia illustrates this pattern with a PizzaBuilder example: http://en.wikipedia.org/wiki/Builder_patternI find it difficult to understand why one would ...
Hy there !What part of MVC approach the Struts Action and the Struts Form bean are: Model, View or Controller ?ThanksMarco
Hi,I've been reading about the Strategy Pattern and I would liek to implement into one of my own small projects.I have an application called WatchDog, this application checks some directories (provided as parameter) and puts every item in a directory in an appropriate mysql table.I have this ...
4613 byte By
javiousa at 2007-11-27 5:16:51
Ok, I have written a gallery that allows gallery owners to create/maintain albums, provide images along with their initial comments for the image and allow other users that has been authorized by the owner to add images/comments. In addition to this, other permitted gallery users may browse ...
[url #"style="display:block;background-image:url(' http://www.system16.com/screens/puyopuyo2_a.jpg'); width:320px; height: 246px] [/url]
.
747 byte By
amartela at 2007-11-27 5:22:00
Hi everybody,We are designing a system where we want to access a Workflow System (Bonita) installed in a remote server. To do that we want to provide a service following the Facade pattern to give access to the API of the Workflow System through either a RMI or Web services (it seems us WS are ...
I would like some advice on the project i'm currently working on.First you should know that i know how to program in Java and i have created some small sites already using JSP and Beans and a May database in the background. But so far all i have done is A to B to C programming considering each ...
682 byte By
CbbLea at 2007-11-27 5:26:33
Hi!In 50% of the websites I've found they count MVC as a design pattern, in the other 50% they count it as a framework...What is your opinion about it?Since design patterns describe "solutions" on recurring problems without making it code specific, meaning different implementations could make ...
I am having trouble with resizing the screen in this program where I use a buffered strategy to buffer my screen. Here's the problem area in my code:GraphicsDevice <graphicsDevice> = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice();<displayMode> = new ...
So, just browsing through these forums, I see many posts by prospective game designers wanting to get started. But many of these questions are so ill-researched or off basis that most people don't even know how to respond. So here's a quickie guide on how to get started learning to make a ...
1784 byte By
lk@ucsca at 2007-11-27 5:33:27
I don't know what happened, but I completely understood the concept of big-oh notation in the lecture, but when I read it again in the textbook, I got lost. Here is what my textbook says:Q(1)"In general, O(f(n)) means that the quantity being measured is at most c X f(n) for some constant ...
Hi guys,I have the following question: I have some functionality which is divided in two parts: basic functionality that is created implementing only one interface , i.e. IBasicClient, and functionality that is methods with different data types as parameters , i.e.:ISDOClient, IStAXClient , ...
i am developing a 2d game with my friend and we would like user input for what we have so far. thers a link to comments at the top or u can comment here, and we understand that ther is only one level. http://topgun.freespaces.comthx in advance
Hello I am using DAO for persistent layer in my project. There are cases when i need to access more than one DAO to manage transaction .To achive this i am passing Connection object in every method which isneeded in transaction .But for this i have to duplicate every method of every DAO .I ...
what would be the fastest way to load images. currently i am using ImageIcon and it seems to be slowing evrything down.
I have an array of object.I want to perform the permutation combination on 2D array to fetch the all possible combinations of n(row)-5(column-fix) elements.suppose i have 5 rows and 5 columns in the table then it should generate all possible combinations i.e(120) without repeating the elements. ...