Mahesh Shiwani

Greenhorn
+ Follow
since Oct 04, 2004
Merit badge: grant badges
For More
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 Mahesh Shiwani

To avoid this exception you have to feed a valid integer or float values to parsers... this is the idea only... as you can not peal coconuts using potato pealers.. so to avoid breakage (of pealer) use potato only... not the coconut.. otherwise.. just check before pealing.. whether you are trying with potato only or not.... simple..
17 years ago
Here is the complete code this time... just check this out...

import java.util.HashSet;
import java.util.Iterator;

/*
* Created on Nov 15, 2006
*
* TODO To change the template for this generated file go to
* Window - Preferences - Java - Code Style - Code Templates
*/

/**
* @author shivanim
*
* TODO To change the template for this generated type comment go to
* Window - Preferences - Java - Code Style - Code Templates
*/
public class Conversion {

public static void main(String[] args) {
Conversion c = new Conversion();
c.combinations("Sanjeev");
}
public void combinations(String s){
char[] original = s.toCharArray();

int i=0;
int j=0;
HashSet hashset = new HashSet();
while(original.length != 0){

String sb = new String();
String temp = new String();
for(i=0; i<original.length-1; i++){

sb = temp+sb+""+original[i];
temp = sb.toString();

for(j=i+1; j<original.length; j++){
sb = temp+""+original[j];

hashset.add(sb);
}
sb = "";
}
original = removefirst(original);
}
printhashset(hashset);
}
public char[] removefirst(char[] aa){
char[] newarray = new char[aa.length-1];
for(int i=0; i<aa.length-1; i++){
newarray[i] = aa[i+1];
}

return newarray;
}
public void printhashset(HashSet hs){
Iterator iterator = hs.iterator();
while(iterator.hasNext()){
System.out.println(iterator.next());
}
}
}

Save the file as Conversion.java; compile it and run.. let me know if desired effect is achieved or not...
Regards,
Mahesh Shiwani.
17 years ago
Try this code... and tell me if this is what you were trying to do...

public void combinations(String s){
char[] original = s.toCharArray();
int original_size = s.length();
String sb = new String();
String temp = new String();
for(int i=0; i<original_size; i++){
sb = temp+sb+""+original[i];
temp = sb.toString();
//System.out.println("temp "+temp);
System.out.println(sb);
for(int j=i+1; j<original_size; j++){
if(i==j)continue;
sb = temp+""+original[j];
System.out.println(sb);
}
sb = "";
}
}

Regards,
Mahesh Shiwani.
17 years ago
Would like to get name of some good books to study for SCWCD.
Thanks
How do you change the border style on a form's combo box? I used "border-style : solid;" to make the text input boxes flat (as opposed to the standard chiseled or beveled), but the tag does not work for the combo boxes. I seem to be able to flatten out the borders of all form elements except this one!

thanks in advance......
Mahesh
you are absolutly right Eric, when i change pages i loose the object and that is the problem. is there any way that i can check in windows registry for some other place say "whether any window in this system (PC) with name 'X' is already opened or not".... looks simple question but till now no answers.. :-))
Thanks & Regards,
Mahesh......
Hi All,

i want to check whether a popup (or any other window) with a particular name say 'x' is already opened or not. And twist in story is that i am opening child window from two(or more) different parent screens, and all the time child window name is same. so i want to check whether child is already opened, no matter from any parent screen.

Thanks & Regards,
Mahesh Shiwani.
Hi all,
in key=value pairs of .properties file in java; how can i give value in two rows for example

name=Mahesh
shiwani

b'coz value i am providing is very very long.

Regards,
Mahesh Shiwani.
19 years ago
HI All,
I have one JSP which shows some result on a search criteria and shows that in a tabular manner. on that jsp i have a button for "Export to Excel".

what i am doing is on click of that button i am passing the data (which is in session) to another jsp with contect-type as "application/vnd.ms-excel" and mean while one more jsp (popup) which is showing "exporting......".. now problem is when my export to excel is completed how can i close that pop up window...?

as my page has content type "application/vnd.ms-excel".. i can not say body onLoaad=something to close window
b'coz it's no more html page....

suggest solutions......
Thanks in advance.. :-))
19 years ago
JSP
HI all,
i am trying to send mail from my java application. but getting follwing error.. no clue why it is here..... here is log

java.lang.NullPointerException
at javax.mail.internet.MimeUtility.checkAscii(MimeUtility.java:915)
at javax.mail.internet.MimeBodyPart.setText(MimeBodyPart.java:812)
at javax.mail.internet.MimeMessage.setText(MimeMessage.java:1333)
at javax.mail.internet.MimeMessage.setText(MimeMessage.java:1321)
Need your help....
Mahesh :-(
19 years ago