Abdul Narayan D'souza TP

Greenhorn
+ Follow
since Apr 01, 2004
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Abdul Narayan D'souza TP

Tom,
Well u have successfully loaded the driver, otherwise u would get a
"ClassNotFound" Exception.

I guess there is a problem with your database url.
Just check it up with your driver's documentation.
Hi
Sobhan,
I guess u cannot do it with StringTokenizer.
U could use LineNumberReader, and check if the returned line is blank.
Anyways u r in the wrong forum,this one deals puerly with "Threads and Synchronization"
Hey bartender where art thou.
18 years ago
Hi
Sobhan,
I guess u cannot do it with StringTokenizer.
18 years ago
Amit
When u do a request.getParameter("checkbox name") and get a String which corresponding to the value of the checkbox u know it is checked.
And if u get null u know it is not checked.
Chow
18 years ago
JSP
Yo Gareth,
There is one context per "web application" per Java Virtual
Machine.Therefore whenever u call ServletConfig.getServletContext() from
any servlet in an application(context) u get the same object.
18 years ago
Well application scope means it is available throught yur application,
apllication object is of type javax.servlet.ServletContext.
while page scope means it is available only for the current page.
page scope --javax.servlet.jsp.PageContext
18 years ago
JSP
Please check if u have created a session, when u access
your servlet for the first time.
HttpSession session=request.getSession(true);
a beter way to do this is to use RequestDispatcher
code---
RequestDispatcher rd = request.getRequestDispatcher("JSP path");
rd.forward(request,response);
--You dont need to store the values in a session, cause
u get access to the orignal request object.
18 years ago
Tejas,
I am not sure MS Internet Explorer allows you to open two windows,
with the same name. Because two calls to "Window.open" with the same window name will always open one window.
There is a way to get around this, you should use window names like
"Window"+some random value;
this will guarantee a unique window name.
-
18 years ago
JSP
Anthony,
You could try this. I have assumed that each sprite thread has
a reference to a sprite object. i mean one to one mapping of sprite objects
and sprite threads
class YourTimer{
incrementTimer(){
//increment code goes here
}
}
class Sprite{
//Keeps track of how many sprite intances are created /
//threads are running
static int spriteCount;
updatePosition(){
//
}

drawSprite(Graphics g){
//drawing code goes here
}
}
volatile boolean timerIncremented=false;
volatile int drawingComplete=0;
Main Thread
void run{
while(true)
{
synchronized(yourTimer){
//increment timer()
yourTimer.incrementTimer();
timerIncremented=true;
//notify sprite threads of timer increment so
//they can udpate position
yourTimer.notifyAll();
}
drawingComplete=Sprite.spriteCount;
while(drawingComplete!=0){
//wait until all sprite threads have updated their
//positions
sleep(delay);//surround with try catch
}
//draw the sprite locations
//call the drawSprite method of each sprite object
delay(timerdelay);
}
}
Sprite Thread
void run()
{
while(true){
synchronized(yourTimer){
if(!timerIncremented)
{
yourTimer.wait();//surround with try catch
}
}
//wake up when the timer has incremented..
// timer is in the mainthread
sprite.updateposition();
//decrement drawingComplete
drawingComplete--;
}
}
I am pretty sure this will work.
-