Kris Decker

Ranch Hand
+ Follow
since Jul 25, 2001
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 Kris Decker

hey all,

Working at a new place, and they are using an OLD api... Anyone know where I can find documentation on com.ibm.vap.Persistence.PersistentHomeCollection

or anything else in that package?

TIA!
kris
19 years ago
After scouring these forums for help calculating elapsed days, I found an article on java world that gave me exactly what I wanted...
http://www.javaworld.com/javaworld/jw-03-2001/jw-0330-time-p3.html
I was getting inconsistencies when trying to calculate elapsed from Jan 3, 2031 to October 3, 2031 using the millisecond calculation approach (off by 1 day)
I tried attacking it using the calendar class (DAY_OF_YEAR) adding, etc, but then dealing with elapses of multiple years gave me trouble.
This approach works for me!
20 years ago
Well, then that lends the question:
How do programs such as JProbe force garbage collection when you click on the garbage collection button?
22 years ago
Is there any way to FORCE garbage collection? I have put some calls to System.gc() in my code but (as I expected) the system sees the call but keeps chugging (no garbage collection)
Any help would be greatly appreciated.
Kris
22 years ago
Hi all,
Working on a project where we have a slight (big) problem with an OutOfMemoryError
Basically, the app just sucks more and more memory and then (when the VM reaches 150MB of memory) swing crash and burns.
I used a program (JProbe) to look at memory usage, and of the 150MB VM and mem usage size, the app was only using 30MB. Also, garbage collection seems to be working while in JProbe.
If I minimize the app, the VM and mem usage drops to less than 10MB and--upon restore--comes back to a reasonable 50MB.
I have pondered going over the code and adding some calls to System.gc(), but i am not satisfied that will solve the problem.
As a band-aid, I am going to try upping the memory limits using
-xmx, but I would LOVE to know why the JVM is such a beast. I am using IBM's JVM 1.2.2
Any thoughts would be helpful.
22 years ago
Hi,
I need to keep a dictionary of key value pairs. I decided to use HashMap to do the deed.
Now ,I am a bit rusty on this, so I would really appreciate some help. I am seeking an initialization/construction similar to an Array.
Would something like this work?:
class SomeClass{
import java.util.*;
static HashMap myMap = {(key1, value1), (key2, value2)};
}
Is there a better way to store static (unchanging) key/value pairs?
Thanx a mil!
22 years ago
Frightfully elementary question, I am afraid:
If you have a loop, (from Mughal book):
double matrix[][] = new double[3][];
for(int i=0; i<matrix.length; ++i)>
matrix[i] = new double[i+1];
wouldn't this start by assigning matrix[1][0]--with matrix[1].length==2? Doesnt the prefix ++ operator occur before the loop? the book claims it assigns matrix[0][0]--with matrix[0].length==1.
this is from page 92 of APGJC
thanks for the help!

BTW-- I just noticed my promotion to Ranch Hand
Thank you both for teh swift reply. I havent had the cnahce to read the JLS section yet, but I think I have a good grasp on teh difference between break and continue.
However, one question remains:
if there is a break within a nested loop, does it break out of ONLY the inner loop--or doest it break out of the inner and they outer loops (assuming there are two loops)?

Originally posted by venugopal askani:
Hi Kris
The basic difference between continue and break is as follows:
continue takes the control to the first statement of the corresponding loop whereas the break statement exits from the loop.
Your programme is got many errors and so i have written my program modifying urs..which goes as follows
import java.io.*;
public class Test
{
public static void main(String args[])
{
for(int i=0;i<10;i++)
{
//doSomething();
System.out.println("Entered the outer loop");
for(int j=0;j<2;j++){ // for loop to be executed perfectly
if(j==0){ // requires boolean condition
break;
}
//doSomethingElse();
System.out.println("Entered the inner loop");
}
}
}
}
Here the if condition tests for value of j equal to o and then exits since it comes across break statement. Hope this example solves your doubt.
Regards
venu


I am reading the RHE book right now.
I am a bit confused over the difference between a break and continue.
I understand that continue will cause you to break out of a loop (possibly to a place designated be a label).
Breaks seem to be essentially the same thing? Also, what is the scope of a break? For example:
for (int i=0; i<10; i++){
doSomething();
for (int j=0; j<i; j++){>
if (j=2){
break
}
doSomethingElse();
}
}
What happens with the break? Do you do the next iteration of i?
I really liked the book XML Primer
please correct me if I am wrong, but I believe this would be overloading, not overriding. With B, you are saying that, in the child class, if the parameters passed are of type int, then this implementation returns an int.

Originally posted by Jordi Marqu�s:
Hi!
This question if from mock of Sun web:
Which of the following methods would be legal (individually) at line 2 in class Test2?
Consider these classes, defined in separate source files:
1. public class Test1 {
2. public float aMethod(float a, float b)
throws IOException {
3. }
4. }
1. public class Test2 extends Test1 {
2.
3. }

A. float aMethod(float a, float b) { }
B. public int aMethod(int a, int b) throws Exception { }
C. public float aMethod(float a, float b) throws _Exception { }
D. public float aMethod(float p, float q) { }
The correct answer is B and D
I don�t understand why B is correct . Why B don�t return an int type?? Why can an int method override a float method???
Thank you in advance


I have found varying behavior with XSL depending on whether I use XML Spy or IE.
Also, the Namespace will have an impact
[This message has been edited by Kris Decker (edited August 29, 2001).]
I posed this question in a couple of threads...
Is anyone using XMSG? I am just curious. Seems SOAP is much more popular. Could someone familiar with both outline similarities and differences?
http://www.w3.org/TR/xmsg/
there should be more!
22 years ago