3685 byte By
jdupreza at 2007-10-2 20:31:41
Hello,I have a Java client that has to issue requests at fixed rate to a remote server.The original programmer did it genuilely (and monothreaded):public class Client { public Client(int rate) {this.delay = ...; //conversion and rounding algorithm omitted; } public void sendRequests() {while ...
409 byte By
n_azmana at 2007-10-2 20:32:32
Hi,I would like to know how to remove the specific row and column from 2d array.for example, I have the original 4x4 array as below 2-1 -1 0 -1 20 -1 -1 -1 20-1 -1 -1 3let say that i want to remove row 2(bold) and column 2(bold), and the new 2d array should get as below2 -1 0-1 2 -1-1 -1 ...
258 byte By
vlad123a at 2007-10-2 20:32:37
I am making an aerial view snowboarding game where the snowboarder goes thru the terrain park hitting obstacles. The boarder's ability to land an obstacle is based on their speed and other factors at the time of hitting the obstacle. Can anyone help?
Hi there, What's the diference between POJO and JavaBeans ?Thanks
im making a spaceship kinda game kinda like galaga and we are having problems making the player or the enemy disappear after being hit by the bullets. We want the monster to die after 2hits and the player after 3. PLEASE HELP US
I need to take an ArrayList of characters and print combinations of them. The length of the combinations should be from 1 character long to x (an input number) characters long. The characters in the ArrayList can be used more than once. What algorithm can I use?example:x = 5ArrayList contains ...
Can some one explain me in simple terms the difference between proxy pattern and session facade pattern ?Thanks
Hi, guys..I will make a client-server application using j2me and servlet. Servlet will send an png image as a response to j2me. The servlet's actions about the request are:1. servlet will put a small circle image in some parts of the main image, then2. servlet will crop part of the main image ...
471 byte By
qwedwea at 2007-10-2 20:37:03
hello everyoneI need some help to divide an array into 2 arrays with the middle element of the array as the root node. elements less than the root node should be in the left array & greater than root node should be in the right array.And after that if the left array is filled........ then ...
914 byte By
yahooa at 2007-10-2 20:37:55
Hi, I'd like to implement a feature in a breakout game. What I'm trying to achieve is to make blocks (or tiles, things that get destoyed, when hit) to be in different shape than rectangles. Also, I would like to introduce clipping to other objects as well, like balls, bonuses and such. Like ...
Hi, I'm trying to program this matchcard(memory) game for my school project. I need to know how I can set a timer for my program so that when a user clicks a card to flip over, then clicks a second card there is a delay so that both cards pictures are clearly shown, say for... 5 seconds so ...
I've created a number of simulations related to Nuclear power plants, but I've never gotten it right. Its actually quite a feat. I've used two models:1) There are a collection of vessels (reactor core, exchanger, reservoir, turbine, condenser) and pipes connecting them all. They all have a ...
Hi,I'm looking at caching various objects in memory but I cannot work out how it is possible to overcome the problem of child objects becoming stale in the cache:For example, say I had an Order object in cache with a reference to a Contact object. However, the Contact object is also used in ...
How to share Singleton in different JVM?Suppose we have two application installed at different server, how to share the same Singleton?Rakesh
What means "Design patterns"
340 byte By
Kavansa at 2007-10-2 20:44:16
Hi,I am creating a web app with approx 25 web pages with not much business logic.I plan to use struts framework.What I wanted to know was, shall I use value object pattern for my web page? Is there some kind of questionaire which I can take to decide whether I should use VO or ...
449 byte By
Saisha at 2007-10-2 20:48:09
I saw an excellent presentation on Seam, and aside from its integration with JSF and EJB 3.0, I was particularly interested in how they worked in JBoss's version of BPEL, jBPM. I'm not 100% sold on BPEL, but it definitely seems like a great way to reduce coupling and complexity in larger ...
after conrting for example the data is in the from of:1, 1, 12, 23, 15, 15, 15, 45, 45 ,13so how it arrange in final array(and # if 15 is repeate 2 time)plz can any body help me
This may be quite trivial for many of you, but it's not my case...I am trying to implement roles on a user class I've created. What I thought of was creating 3 classes:- Role- Roles (a container for all the existing roles)- UserEach User should be able to contain none, one or many Role ...
Im trying to make a simple text based betting game for schoolCan I enter number values into keyboard class and have it represent a betting amount? Or is keyboard only useful for "Y/N" type questions...Anyone recommend anything better?
Hi,I have 2 objects that the first is extends the second. should i consider any thing in their DAO class or their DAO are distinct?tx
Hi,i'm programming a java-based game. It uses a JFrame that calls an "accelerated window" ( a buffered window with a Graphics2D Object ) to draw a basketball simulation. The problem is that when the accelerated window is running ( loop ) the refreshing and the listeners of the main window ...
316 byte By
musica at 2007-10-2 20:56:29
Hi all,I have 4 tables deal with 4 DAOs. But I have a funcion called search() that get infomation from 4 tables above. Will I put this function in which DAO ?.I see each DAO work only on self table. such as searchBy..., delete, update. But a query complex we will put in which DAO ...
im trying to make a method that takes in an array and makes a new array with the values from 0 to the array.length-1 so that the array it returns will corrispond with the values in the original array (if the number at the original element[ n ] is the higest number of all the array its value in ...
What is use of RSS feeds in a Website. In website when i clicked on the RSS Feed button then a XML file was opening in IE.Can u Pl clarify my doubts.Thanks in Advance.
1295 byte By
aamya at 2007-10-2 21:01:34
Here's my pattern question:Vehicle ObjectSUV Object extends Vehicle ObjectSedan Object extends Vehicle ObjectDecisionMaker Class -- Decides what vehicle to use in the program depending on the weather e.g:public Class DecisionMaker{public Vehicle whatVehicleToUse(){if(raining) return new ...
390 byte By
dounda at 2007-10-2 21:01:55
I am calculating the dot product the straightforward way (see below) and I don't think there is a better (i.e. more efficient) way to do it. I have to compute a very large number of these and was hoping someone might have a suggestion. Would there be a noticeable change if it was computed ...
I want to develop a tool in Java. It is a desktop tool with about 20 or so screens (some of which are complex using multiple controls that need to update each other on the same screen, and others are normal JTable based ones etc).I want to desing and develop the code in such a way that I write ...
public void paint(Graphics g) {map = mapb;gfx = buffer.getGraphics();for(i = 0;i < 11;i++) {for(n = 0;n < 11;n++) {switch (map[n][i]) {case 1: gfx.drawImage(grass,n*50,i*50,null);break;case 2: gfx.drawImage(water,n*50,i*50,null);break;case 3: gfx.drawImage(dirt,n*50,i*50,null);break;case ...
328 byte By
Climaxa at 2007-10-2 21:07:26
Hi I'm writing a networkgame but would like to know how I can detect a list of available hosts on a specific port. I use sockets... I want the game to have a "Host Game" option and then a "Join Game" option which lists all available games. How can I do this. I'm new to networking with Java. ...
2746 byte By
ktm5124a at 2007-10-2 21:08:12
I am developing an online service and I need to validate users and process text messages. I have two ideas for this. Can you tell me which idea you think is better and more OO?1) Create a User object to validate the packet's sender every time I receive a packet. The User object will be ...
483 byte By
Galaxya at 2007-10-2 21:08:55
Hi,I am trying to do a chess game using mvc. The view obviously should handle all the drawing stuff and the model the logic, which means in mvc I have to have a pawn concrete class (model) and a pawnviewer class (view)?If that is the case is there a better solution than to check for the chess ...
Hi,I have 4 questions.1- i want to store my objects in tree because they are hierarchical and behave like tree nodes that start with one root. but should i consider any dependency between my objects(Top object and Butt Objects) as attributs or tree solves such dependencies? if tree could ...
For the life of me I can't understand how to implement a keylistener without using any gui elements. I am writing a text-based rpg and just need to check to see which keys are being held down at any given moment.if anyone could offer me some sample code i'd be immensely grateful. None of my ...
3465 byte By
ktm5124a at 2007-10-2 21:15:12
It has been my opinion for a while that MVC sucks. It seems to me that it takes away from the OOness of a program. An object should act reflexively -- a piece should move itself, a message should send itself, etc. -- and MVC puts the programmer in this limited mindset of:Controller -> Model ...
I just started to modify the game Tail Gunner in my java class and one of the requirements is to add a high score list. I have the high score list working, but every time the player tries to play again, the list resets.Can anyone help me?
Hi, I'm a college student here developing a tank survival game for the finals. I have had very little experience in AI strategies, so I wonder if anyone here can give me a hint or two to start.Thanks.The game's description is below:Goal: Develop a good AI strategy for survival. ...
hi,the problem is say we have an equation a=b+c+d and i have values of a,b,d. now i need to evaluate d. so the equation should be rearranged as d=a-b-c. how do we do this programatically. i mean we have athe equation stored and at runtime we need to rearrange the equation. how do we go about ...
Hi,I want to initial my root Node to making a Tree. my data model columns are id,parent and leaf . how should i load this tree recursively? i have implemented TreeNode interface.thanks
The task is to generate a chart generator -I have two classes for the same -1) ChartValuesGenerator - this class generates the values which is required to plot the graphs.2) ChartGenerator- this class generates the charts which are required. To generate the chart it requires the values ...
361 byte By
badda1ka at 2007-10-2 21:21:19
I am looking into see how i can design a client side interface that will talk to mulitple web services. This client side interface will act as proxy and call multiple web services based on the input from web services clients. Can someone give some ideas/pattens that i could use to design this? ...
292 byte By
_AM__a at 2007-10-2 21:21:50
Hi, i have a basic question, how many instances of a singleton will be created in a multi threaded environment. 1. As every thread has it's own object... does it mean, every thread has its own instacne of singleton class? thanks in advance..thanksSJ
Hello all.I am a high school student and regularly go to contests that involve problems of finding the shortest path to solve a maze. The path inputs will be from file, a grphical representation of the maze, with each grid either being a wall character (say, ' * '), a path character (say, ' ...
Hi Members,I want to write a program to download a zipped file from a web site.I mean my program should connet to that site and starts downloading the file.Can anybody please provide me the sufficient knowledge about this.Thanks in advance,NetBeans.
Hi GuysI'm making a multi player browser game. The game will have some forms to setup data into the database and the player will be able to check other players data.I will load the players data from the DB into a Bean when the application starts and then just get the other players information ...
I'd like to have some opinions on each, what should be best used ?I'm a bit confused about wich should be used and when ... And what about Helper classes ?Thanks
Hi.Does anyone of you know some nice (and possibly already implemented) algorithms for the k-shortest-path problem? In particular, I am interested in some special features: it has to work with a directed, weighted graph and should ignore loops, i.e. it should work with simple paths. And I ...
391 byte By
-@-a at 2007-10-2 21:32:48
I happened to read an article in today's San Jose Mercury describing impending layoffs at Sun. This article said that Sun had removed its "poison pill" measures that had been intended to counter any hostile take-overs. I am no expert on this subject. But I am wondering if MIcrosoft would ...
I would like to know how a framework is built.What are the good design steps to be followed for an effective framework?Which are the design patterns to be followed?It would be helpful if anyone could enlighten me on this subject.
2455 byte By
ktm5124a at 2007-10-2 21:40:12
I have some questions on GUI design. I'm making an Instant Messenger and, having finished the server, I am now working on the client. I've made many GUIs before -- I'm familiar with swing, awt, and swt --but I feel like my design of GUIs is bad. For this particular project I am using ...