Prasanna Kumaar

Ranch Hand
+ Follow
since Feb 08, 2011
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
2
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Prasanna Kumaar



when i include this statement in my .jsp(MyJsp.jsp)
<bean:define id="sample" name="customForm" type="com.renault.rdc.web.formBean1" />


i get the below error
ServletException in '/MyJsp.jsp': Cannot find bean formbean1 in any scope
10 years ago

karan chandok wrote:parseAllFiles(f.getPath());

for(File f : filesInDirectory)



Got null point exception in these two lines

Any suggestion please



you might have got that because your parent directory may be empty...incase if the parent directory is not empty please tell about the contents in parent directory...!!!
10 years ago

Rob Spoor wrote:And what does lastIndexOf return if there is not dot in the String? And what will that specific return value do with the calls to substring?




First check for indexOf(".") if it returns true then check for LastIndexOf(".")
10 years ago

Rob Spoor wrote:I quote one case:

fred rosenberger wrote:What if it were "JPG"?


More precisely, what will x be in that case, and what will be the results?




i wont think it will cause any effect as you are using only lastIndexOf
10 years ago

Andreas Svenkson wrote:Hi guys, I was rehearsing some stuff regarding initialization and was wondering about this code..



If line 3 is commented out, and line 4 is uncommented, we will get the expected "illegal forward reference" compiler error. My question is, why exactly does line 3 not cause this error?
For those interested, there is more information here: http://java.sun.com/docs/books/jls/second_edition/html/classes.doc.html#287406

I have my suspicions but still find it slightly unreasonable; because while 'j' is used on the left hand side of an assignment, it is arguably also on the right hand side.

// Andreas




line 4 won't work... It's because you cannot refrence a field before it is defined.

Ashish Maharaja Singh wrote:please tell me the error in my concepts. I am get this error on line "TempArray ta = new TempArray(le,ri);"







i think its because you did not declare size and TempArray variables..and another fault i see is class TempArray does not have a method named "Show"
10 years ago

James Sabre wrote:

Prasanna Kumaar wrote:
Actually My CSV files format is
1231231,some string
i.e first 7 characters are numbers then separator then some text.
the junk characters occurs before the number part it seems. can you help me out?



Please re-read my response. I have explained what the 3 junk characters are and how to deal with them. To re-iterate; to understand the problem follow the link to the BOM Wikipedia site. You can either manually remove the junk characters or you can employ my much plagiarised class BOMStripperInputStream obtained by following the other link I gave.



I opened the file using UTF-8 . but now "" these characters are replaced by "?"
11 years ago

James Sabre wrote:

Prasanna Kumaar wrote:

fred rosenberger wrote:What makes a character a 'junk' one?



while reading some of the .CSV files the following double quoted characters were present in the begining of first line ""

...all other lines were normal



The characters are the BOM for utf-8. Java is very bad at dealing with BOMs and the BOM can be removed and you should then open the file using utf-8 character encoding. My class BOMStripperInputStream plagiarised on several sites can help to remove the BOM.



Actually My CSV files format is
1231231,some string
i.e first 7 characters are numbers then separator then some text.
the junk characters occurs before the number part it seems. can you help me out?
11 years ago

fred rosenberger wrote:What makes a character a 'junk' one?



while reading some of the .CSV files the following double quoted characters were present in the begining of first line ""

...all other lines were normal
11 years ago
I am reading a CSV file using a java program.
It seems that some of the .csv files i read using my program contains junk characters, how read the contents of the file wihtout reading the junk characters?
11 years ago
I have String say Str it usually has a 10 digit number..how to test it contains numbers between 0-9 only
11 years ago

Ulf Dittmer wrote:Check the AccessingFileFormats page for links to several CSV processing libraries.



sorry, CSVformat is not specified..
11 years ago
Hi,

Can you Please tell me,
How to read/Import data from CSV file into JAVA file?
11 years ago

Gene Hilpert wrote:Sorry I have not been watching this forum.

1) first create a copy of the orginal parent record with a new Primary key.
2) change the FK on the child record to the primary key of the new parent record you just added.
3) delete the old parent record because you dont need it any more.
4) ask your DBA why he or she would ever use as a primary key data that might need to be changed. (well ... maybe you should not ask this question)




It worked ....Thanks
11 years ago
Change the while loop condition as >= 1, your program will work 100%

public class BeerSong{
public static void main (String[] args){
int beerNum = 99;
String word = "bottles";

while (beerNum >= 1){

if (beerNum == 1){
word = "bottle"; // singular
}
System.out.println( beerNum + " " + word + " of beer on the wall" );
System.out.println( beerNum + " " + word + " of beer" );
System.out.println("Take one down");
System.out.println("Pass it around");
beerNum = beerNum - 1;
if (beerNum > 0){
System.out.println(beerNum + " " + word + " of beer on the wall");
}else {
System.out.println("No More bottles of beer on the wall");
}

}

}
}
11 years ago