Win a copy of Classic Computer Science Problems in Swift this week in the iOS forum!

Hema Sukumar

Greenhorn
+ Follow
since Dec 22, 2000
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 Hema Sukumar

Has anyone checked the Os name on a Win98 m/c ?
My system is running on Win98SE & when I call
---------------------------------------
String osName = System.getProperty("os.name" );
System.out.println ( "This machine's Operating System Name: " + osName);
-----------------------------------------
It returns the operating System as Win95. Little weird !! why is that ? Am I doing anything wrong ?
-Hema
15 years ago
Thanks Cindy..
Looks like thats what my problem is. The setup.exe that I'm invoking totally spans another thread & gives an unreliable exitcode & waitcode every time I run it.
I should think of a work around
Thanks,
Hema
15 years ago
Hi,
I'm developing an installation wizard using Swing.
Basically the GUI screen displays the info about the product to be installed & when the user clicks the install button it should call the setup.exe for that product.
What I have done is..
In the actionperformed () method, I have used runtime.exec to call the setup.exe for that particular product. It works & does the installation.
After the installation is complete , I want to show a new window saying that the installation is successful . Rightnow, it shows the window
while the installation is halfway through.
How do I use the invokelater or invokeandwait method to acheive this ?
Here is the sample code that I'm using..
--------------------------------------------
public void actionPerformed(ActionEvent e)
{
if (e.getActionCommand().equals("Back"))
{
System.out.println("Installing Modem Drivers....\n");
Runtime rt = Runtime.getRuntime();
String[] call =c:/hema/modem/setup.exe"};

try {
Process proc = rt.exec(call);
InputStream is = proc.getInputStream();
InputStreamReader isr = new InputStreamReader(is);
BufferedReader br = new BufferedReader(isr);
while(br.readLine() != null){
System.out.print(br.readLine());
}
proc.waitFor();

System.out.println("Process exit code is: " + proc.exitValue());
System.out.println("Process wait for code is: " + proc.waitFor());
//Window that I would like to show up after the external installation is complete
Runnable Update = new Runnable() {
public void run() {
SuccessPanel msp= new SuccessPanel();
sp.showWindow();}
} ;
SwingUtilities.invokeLater(Update);

}
catch(IOException ioe) {
System.err.println( "IOException starting process!");
ioe.printStackTrace();
}
catch(InterruptedException ie) {
System.err.println("Interrupted waiting for process!");
}

}

}
------------------------------------------------
Has anybody done this before ? Any inputs is highly appreciated !!
Thanks,
Hema
15 years ago
Hi,
I'm developing an installation wizard using Swing.
Basically the GUI screen displays the info about the product to be installed & when the user clicks the install button it should call the setup.exe for that product.
What I have done is..
In the actionperformed () method, I have used runtime.exec to call the setup.exe for that particular product. It works & does the installation.
After the installation is complete , I want to show a new window saying that the installation is successful . Rightnow, it shows the window
while the installation is halfway through.
How do I use the invokelater or invokeandwait method to acheive this ?
Here is the sample code that I'm using..
--------------------------------------------
public void actionPerformed(ActionEvent e)
{
if (e.getActionCommand().equals("Back"))
{
System.out.println("Installing Modem Drivers....\n");
Runtime rt = Runtime.getRuntime();
String[] call =c:/hema/modem/setup.exe"};

try {
Process proc = rt.exec(call);
InputStream is = proc.getInputStream();
InputStreamReader isr = new InputStreamReader(is);
BufferedReader br = new BufferedReader(isr);
while(br.readLine() != null){
System.out.print(br.readLine());
}
proc.waitFor();

System.out.println("Process exit code is: " + proc.exitValue());
System.out.println("Process wait for code is: " + proc.waitFor());
//Window that I would like to show up after the external installation is complete
Runnable Update = new Runnable() {
public void run() {
SuccessPanel msp= new SuccessPanel();
sp.showWindow();}
} ;
SwingUtilities.invokeLater(Update);

}
catch(IOException ioe) {
System.err.println( "IOException starting process!");
ioe.printStackTrace();
}
catch(InterruptedException ie) {
System.err.println("Interrupted waiting for process!");
}

}

}
------------------------------------------------
Has anybody done this before ? Any inputs is highly appreciated !!
Thanks,
Hema
Hi,
I'm developing an installation wizard using Swing.
Basically the GUI screen displays the info about the product to be installed & when the user clicks the install button it should call the setup.exe for that product.
What I have done is..
In the actionperformed () method, I have used runtime.exec to call the setup.exe for that particular product. It works & does the installation.
After the installation is complete , I want to show a new window saying that the installation is successful . Rightnow, it shows the window
while the installation is halfway through.
How do I use the invokelater or invokeandwait method to acheive this ?
Here is the sample code that I'm using..
--------------------------------------------
public void actionPerformed(ActionEvent e)
{
if (e.getActionCommand().equals("Back"))
{
System.out.println("Installing Modem Drivers....\n");
Runtime rt = Runtime.getRuntime();
String[] call =c:/hema/modem/setup.exe"};

try {
Process proc = rt.exec(call);
InputStream is = proc.getInputStream();
InputStreamReader isr = new InputStreamReader(is);
BufferedReader br = new BufferedReader(isr);
while(br.readLine() != null){
System.out.print(br.readLine());
}
proc.waitFor();

System.out.println("Process exit code is: " + proc.exitValue());
System.out.println("Process wait for code is: " + proc.waitFor());
//Window that I would like to show up after the external installation is complete
Runnable Update = new Runnable() {
public void run() {
SuccessPanel msp= new SuccessPanel();
sp.showWindow();}
} ;
SwingUtilities.invokeLater(Update);

}
catch(IOException ioe) {
System.err.println( "IOException starting process!");
ioe.printStackTrace();
}
catch(InterruptedException ie) {
System.err.println("Interrupted waiting for process!");
}

}

}
------------------------------------------------
Has anybody done this before ? Any inputs is highly appreciated !!
Thanks,
Hema
15 years ago
Hi,
Can somebody throw some light on how to hide a selected row from the JTable ? Is it possible to still have the hidden values in the table model ?
Thanks,
Hema
16 years ago
Guys,
I even had questions about Pseudo columns on a telephonic interview though I applied for a Java Programmer position . Some other basic SQL questions I would expect are..
1. Difference between query, subquery & correlated subquery.
2. Diff between functions & procedures
3. Diff between package & procedures
4. How does having an index improves the search performance..?
It's better to go through a SQL primer & prepare your own
notes & possible questions. So you will be ready for any SQL interview now & in the future.
Good Luck !!
Cheers,
Hema
17 years ago
Hi Peter,
Thanks for the tips.
I would very much like to try the approach you have mentioned
in point no 3. But some companies are little skeptical with
that when it comes from the candidate who needs a Visa sponsorship.
So I'm helping out with protyping from Lotus notes to Java & Oracle for a friend who is a budding Dotcomer ( Is it a bad word these days ??). I do this from home & can't call it a
real project experience because there is no team, no directions & no Boss !!. But this is what the best thing I could do now.
Right now there is lot of hiring freeze in Bay area. Hope things improve when the market picks up again.
Java Ranch is what will keep me going until then !!
Cheers,
Hema
17 years ago
That was a very good tip, Peter..
I'm a junior programmer myself with less than one year of experience in java. I'm a SCJP self taught with jdbc, servlets. I love working in java & When I say I know something, I really make sure that I know it before putting it on my resume.
But I had bad experiences in the two interviews I have attended so far, just because I didn't answer well in the questions
in the skill set which the interviewer presumed I knew well.
I have put SQL, PL/SQL in my resume.But that doesn't mean that I'm a hard core SQL programmer. I'm just a java programmer who can write SQL if needed with jdbc.

First I had a 45 mins telephone interview with this 'BIG' company. I was asked all Oracle questions.. Join, Trigger,
cursor etc etc.. for 40 mins. I tried my best to answer & surprisingly I didn't do very bad and I was asked java questions just for 5 mins. When I asked the guy, whether it was SQL intensive position, he told me they were looking for somebody with both java & SQL knowledge & I seemed okay..
Then I went for a personal interview. The first guy asked me lots of questions in Oops concepts & I did well. The second guy
asked me lots of vague analytical questions & few riddles too.
The third guy who interviewed me over the phone came with a bunch of SQL questions & made me write all sorts of statements.
I wrote few, stumbled at few and I also knew that I have lost
the interview then.
Finally I got the feedback from a friend who works there saying, first guy was very impressed, second guy called me little bookish, third guy feels I'm not good at SQL & so not good enough for the position. I really felt cheated because I was not tested on what I know but my performance was based on something what I didn't know & on some stupid riddles. It was an utter waste of time for me & for them because they were not clear about the skill sets required for the position and I was not clear about what was expected out of me.
Next time I'm really really going to make sure that I'm being tested on what know :-). just waiting for the break !!
In the mean time, Can you tell me what is expected out of a junior programmer who doesn't have much of project experience ?
How can I avoid being called 'Bookish' !!
Thanks,
Hema

17 years ago
Hi Peter,
Thank you very much.
Sorry for bothering you with such silly mistake. Sometimes I tend to over look these little mistakes for Big bugs
Anyway, I'm still very much junior to java & learning a lot every day.
Cheers,
Hema
17 years ago
Thanks Peter,
I just sent a copy of my code to yr mail id.
-Hema
17 years ago
Hi,
Is there anyway to check the end of file with the Buffered Reader ?
The traditional way of doing it as below,
------------------------------------------------------
String s;
while ( (s= br.readLine()) !=null)
-------------------------------------------------------
doesn't work for a text/html file which has some blank lines & then continuing with lines of data.
The method above breaks the loop as soon as it comes across an
empty line. Where as I want the loop to continue till it reads the whole file even it comes across some empty lines.
Any help will be highly appreciated.
Thanks,
Hema
17 years ago
Thanks Peter..
What will I ever do without Java Ranch ..
-Hema
17 years ago
Hi,
I'm trying to read a HTML page & print out the email id's in
that page. I have a problem while using the String Tokenizer.
I pass the "mailto:" tag we use in the HTML to identify the email id's as the delimiter string in the String Tokenizer.
Here's the sample HTML page & the java code I used.
HTML Page
------------------------------------------------
<HTML>

<BODY LINK="#FFFF00" VLINK="#FFFF00" BGCOLOR="#000000">


<CENTER>

Hema's Page


Mail me...

</CENTER>

</BODY>
</HTML>
---------------------------------------------------------------
When I used "mailto" as delimiter while reading this file,
I expected it to print every line after "mailto" & I thought
I can get the substring between : and " as email id.
i.e, -----------------------------------------------
:hemasu@hotmail.com">Mail me...

</CENTER>
</BODY>
</HTML>
-----------------------------------------------
But what I got instead was the delimited output of every line for the individual characters in the String.
ie. Something like this...
---------------------------------------------------
<HTML>

<BODY LINK="#FFFF00" VLINK="#FFFF00" BGCOLOR="#000000">

<FONT FACE="C<br /> c S<br /> ns MS" SIZE=5 C<br /> r="#FFFFFF">
<CENTER>

He
's P
ge


<A HREF="<BR rel="nofollow">he<br /> su@h<br /> .c<br /> ">M
e...

</CENTER>
</BODY>
</HTML>
--------------------------------------------------------------

The java code I used is..
-------------------------------------------------------------
public static void main( String[] args)
{
try {
String filename = "hema.html";
BufferedReader br = new BufferedReader( new FileReader(filename));

String s;
while ( (s= br.readLine()) !=null)
{
//System.out.println(s);
String set = "mailto:";
StringTokenizer st = new StringTokenizer(s, set);
while (st.hasMoreTokens())
{
String token = st.nextToken();
System.out.println(token);

int start = token.indexOf(':');
System.out.println(start);

int end = token.indexOf ('"');
System.out.println(end);

String email = token.substring( start, end) + "," + "\n";
System.out.println(email);
PrintWriter pout = new PrintWriter( new FileWriter("email.txt"));
pout.print(email);
}

}
br.close();
pout.close();
}
catch (Exception e) {
System.err.println(e.getMessage());

}


}

It's reading the HTML page & printing every line correctly. But I have trouble printing & processing the tokens.
Any help will be highly appreciated.
Thanks,
Hema
17 years ago
Sorry, I meant class Variable.
What I meant was, int a is not a class variable but a member/instance variable.
17 years ago