# MEHULecs DIKSHITecs

Greenhorn
since Nov 20, 2003
For More
Cows and Likes
Cows
0
In last 30 days
0
Total given
0
Likes
0
0
Total given
0
Given in last 30 days
0
Scavenger Hunt
Ranch Hand Scavenger Hunt
Greenhorn Scavenger Hunt

## Recent posts by MEHULecs DIKSHITecs

System.out.println("Please enter the string you would like to locate:");
System.out.println(fileName + " " + input);
total = 0;
System.out.println("There were matches at:");

while ( readLine != null )
{
//next = st.nextToken();
//charCount = charCount + next.length() + 1;
//lineCount = lineCount + 1;
while ( st.haToken() )
{
total++; // if coffe is is available then count++
//if (next.equals(input))
//{
//System.out.print("Line:" + lineCount + "\nColumn:" + charCount);
//}
}
}
System.out.println(total);
20 years ago
Hi chandra
Try putting System time in miillis before and after the code where
you actually fetch data from RS for adding to ArrayList.
You will find the java itself takes lot of time in retriveing data from RS
This slows your process there is not much you can do about it
20 years ago
/*
class Prime
Input
The maximum integer upto which primes have to be generated
Output
The prime integers each separated by a white space and ending with
a new line character
Algorithm
1) Instantiate a list of max integers with initial value 0
2) Start at the first number say "i" on the list
which has not yet been considered(should not start from 1)
3) Check if the value of the ith element in the list is 1
if it is 1 increment i otherwise proceed to step 4
4) Set all numbers of the list which are multiples of i to 1
Increment i and go back to step 2
*/
class Prime
{
public void computePrime(int max)
{
int [] intArr = new int[max+1];//Array of integers. For convenience we are making an array of max + 1 instead of max
for(int i = 2; i <= max; i++)
{
if (intArr[i] != 1)
{
System.out.println(i);
for(int j=2*i; j <= max; j+=i)
intArr[j] = 1;
}
}
}
public static void main(String [] args)
{
int max = 50;// Max num upto which primes have to be generated
Prime prime = new Prime();
prime.computePrime(max);
}
}
Try this and solve few errors if any
20 years ago
public class DSInfoDlg extends JDialog
{
super (fParent, RM.getString(R_designer.DLGT_DS_INFO));
setModal (true);
setDefaultCloseOperation(JDialog.DO_NOTHING_ON_CLOSE);
}
This works fine but the [X] button in title bar for window closing shows as enable. This creates a doubt to the user who may use this work of mine as to why the window is not closing.
I wanted to know if we can disable (totally remove) this button in the title bar.