Sumiran Pradhan

Greenhorn
+ Follow
since Mar 10, 2010
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Sumiran Pradhan

Reference this link Spring Resource and the section autowiring collaborators
"Autowiring collaborator".

If you still have problems feel free to ask questions.
13 years ago
hmm Interesting question. I would say start studying about using Struts with the tiles. Good references are present all around pick up one and start!
13 years ago
How about going through this and trying to debug on your own? Error that you are receiving
13 years ago
1. Before writing a program, think ONLY in terms of objects.
2. Nothing replaces pen and paper. plan out a pseudo code to follow
3. translate the program to paper.

I think problems with primitives or syntactic errors are easily solvable. The problem is getting the thinking process out on paper the problem. Designing classes(Object oriented view) is the caveat.

Specifically for Java I would definitely recommend
1. Kathy Sierra's book SCJP 6 (good head start)
2. Joshua Bloch's Effective Java (better way of looking at things)

As a whole
1. Headfirst design Patterns book is good.
2. Introduction to Algorithms.
13 years ago
Basically, you need to create another variable that is going to sum all your subjects or averages and then calculate. The formula that you use is incorrect.
13 years ago
Definitely use the List over arrays. If you do not exceed the capacity it is going to be as fast as an array. Better handling and much easier way of doing things.

Something like :

Convert to an array
13 years ago
No. You do not need to setup the account.

The version that you have downloaded is a standard J2SE.

No, you do not need API to work with Java. Those are materials like this J2SE5 API

13 years ago
I always try to use the "equals" member function instead of the "==". Because "==" basically tries to check your location of the objects. Not good, right!



Now, you should basically get what you need.
13 years ago
Okay guys , again I have modified the code and I am still unable to do what I set about doing. I need to implement the runAs command through Java.The problem is that it prompts for a password which one cannot provide in the runAs command.Any help would be great.

15 years ago
My problem is that I am unable to enter the password through my Java Code for runAs implementation.I have tried the same on a single thread.Then I read this article in the forum regarding consuming error streams and input streams.Here is what I tried and its still not working.


Output is :->
Execing cmd.exe /C runAs /user:testAdmin notepad.exe
OUTPUT>Enter the password for bmcadmin:
ExitValue: 1

Now Exit Value 1 would mean an error but I am unable to debug as to what is the problem in this case.Ne help guys?
15 years ago
15 years ago
Hello

I need to implement the runAs functionality using Java.The problem is that runAs does not accept password in command line but as a prompt. I have a small code snippet that I tried.Can some one help me with this.

Process p = Runtime.getRuntime ( ) .exec
( "cmd /C cmd.exe" ) ;
BufferedReader in = new BufferedReader(
new InputStreamReader(p.getInputStream()));
Thread.sleep(1000);
while (in.ready()) {

String x = in.readLine();
System.out.println("The value is :::" + x);
if(x.contains("password"))
{
Thread.sleep(1000);
System.out.println("Inside loop...");
//OutputStreamWriter op = new OutputStreamWriter(p.getOutputStream());
String cmd="global@123";
p.getOutputStream().write(cmd.getBytes());
p.getOutputStream().flush();
//op.write(cmd, 0, cmd.length());
//op.flush();
Thread.sleep(1000);
}
}
15 years ago