Hari Srinivas

Ranch Hand
+ Follow
since Mar 26, 2008
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Hari Srinivas

Thank you very much Mr Campbell Ritchie for the reply. Is there any other way of invoking such a script then using Java??? I would be grateful if you could let me know of this as I need to this and this assignment is due shortly.
15 years ago
Hi All,

i need to run a script in unix from my Java code (as a part of a larger project). I am doing the following



However it doesn't always execute the script( Actually the script in this case generates some files which my program reads later on). Because the files are not always generated, I get a file not found exception later on. (However executing the script as a standalone works). I need some help to understand why this is happening. Thanks a lot in advance
15 years ago
Like I have already mentioned ULf, I have started working on a competition arena(call it whatever you want). It will be great if everybody can actually get together and formulate the rules and a tentative starting date first( a realistic one), and that will speed things up for sure...And thanks for some insightful suggestions, glad to know people still think it can be done.
16 years ago
Ok Ulf...I would like to let you know that I have already started working on the software part of it... . I understand your apprehensions regarding the contribution of questions by ranchers on a regular basis, but why don't we try giving it a shot once? After all that if people still think this wouldn't quite work out, we can scrap it...What say?
16 years ago
SCJD Exam with J2SE
by Andrew Monkhouse
Well i have already had the experience of building n engine very similar to that of TopCoder for my university's inter college online coding challenge and there were other participations from topCoder members also,. Even though it actually wasn't successful(we had a really useless server and it crashed), I expect this one with JavaRanch to do well.
16 years ago
Well I m really interested in getting things started....I need all you ranchers to support and/or contribute....
To Ulf:Sir I 'm not trying to say that we can try and compete with TopCoder, may be we can have a favorable environment in our own JavaRanch...can't we?
16 years ago
Dear Bartenders,Sheriffs and all ranchers
(sounds like Friends...Romans...Countrymen...Doesn't it?)

I was a Java greenhorn until sometime back, but I have made considerable progress because of Coding a lot in Java. How about having regular programming competitions among ranchers? This will help newbies to integrate coding and problem solving techniques and hence learn better and faster. I have been a member of a well known Programming competition site for some time now and I was wondering if we could have an engine similar to(NOT THE SAME) the one those people use. I would like to know what you guys feel about it(Do you already have such a thing going around???). Competition is not always bad.

Thanks a lot for all the replies in advance
[ April 24, 2008: Message edited by: Govind SrinivasaRaghavan ]
16 years ago
Dear Bartenders,Sheriffs and all ranchers
(sounds like Friends...Romans...Countrymen...Doesn't it?)

I was a Java greenhorn until sometime back, but I have made considerable progress because of Coding a lot in Java. How about having regular programming competitions among ranchers? This will help newbies to integrate coding and problem solving techniques and hence learn better and faster. I have been a member of a well known Programming competition site for some time now and I was wondering if we could have an engine similar to(NOT THE SAME) the one those people use. I would like to know what you guys feel about it(Do you already have such a thing going around???). Competition is not always bad.

Thanks a lot for all the replies in advance
[ April 24, 2008: Message edited by: Govind SrinivasaRaghavan ]
16 years ago

Originally posted by Sandeep Sirsekar:
ya that's perfectly fine you are upcasting byte data-type to int data-type.
but what my need is

someMethod(byteArray);//this method is provided by sun in some interface so i can't change.

i want to convert these bytes to string(that i know) but to convert it to int data-type is not known to me.
so that is the problem



If you have a method that can convert a byte array to a String, convert it to a String and then convert the String to an integer.

int converted = Integer.parseInt(convertedString);
16 years ago
Well Fred,James probably didn't get the definition completely right...but I don't see any reason why overloading isn't a type of polymorphism... And Fred I thought the link that you gave was for Type Polymorphism... May be this one would be of more help Polymorphism
16 years ago
Glad to help you... You can check out KMP here Link
17 years ago
yup...i just wanted to say path and i probably messes it up in my earlier post...and i indeed know it is "classpath", the space was unintentional

apologies all around

Sorry for the typographical error in my last rely
17 years ago
I guess if all the names are indeed separated using a single space and if you want the first and last name you can use the split method as below

String names[] = author.split(' ');

Now name[0] will have the string before the space i.e first name and name[1] will have the last name.

If all you are trying is just to split the author name, I hope i might have said something that made sense
17 years ago
Yeah guys...figured it out anyway...and I still don't think that we need to use any loop as requested by Mr Hdd... And I think everybody else except him are trying to work on a solution!

And Campbell I guess you were initially thinking in the lines of using shift operators...were you...I thought you said you were looking at a recursive solution
17 years ago