Win a copy of TDD for a Shopping Website LiveProject this week in the Testing forum!

Pete Harris

Ranch Hand
+ Follow
since Feb 05, 2003
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 Pete Harris

Vicky,

Without more info, this is impossible to diagnose, but as a wild stab in the dark, I'd suggest that something is not picking up the AM/PM string and reading the time as a 24 hour clock thing.

cheers, Pete
17 years ago
Siva,

A weak reference is one that is not recognised by the garbage collector. See here for a definition.

In the context of the question you ask, the difference is that if an object is not referenced anywhere but a weak hashtable in your application, that object may be garbage collected. If that same object was in a normal hashtable, it would not be eligible for garbage collection.

cheers,
Pete
17 years ago
Kashif,

I (along with about 1 million other people, it seems) had this problem and 'solved' it by checking the hash map of logged in users to see if the user was already logged in. If so I transferred all the session attributes over to the newly created session and automatically invalidated the old one.

This had the effect of restoring a user's old session if they logged in before the session timed out, otherwise a new session was created from scratch. It's not a particularly elegant solution and causes quite interesting problems if a user tried to log in twice on different browsers, but it was better than nothing.

cheers,
Pete
17 years ago
If I remember correctly, signing a jar file is only relevant to the files already held within it. If you try and either remove or alter an existing class, the verification will fail.

I guess the reasoning is that adding classes to a jar file does not change the functionality of it so should be allowed. Not sure it makes much sense to me either, though.
17 years ago
Pinal,

Don't really know what to say here - I just copied and pased that code into a class and it runs fine with match being true.

So you're right to expect match to be true, but I don't see why it doesn't for you.
17 years ago
Not sure if you can do an network install, but you may want to look into Advanced Installer.

It's got a system for installing java programs as windows services and creates windows MSI installer files.

Pete
17 years ago
Venkatesh,

The answer here is to write a Comparator which will allow you to specify the sorting algorithm you want to use for your collection.

The only thing to mention is that you should read the javadoc and implement your class with care otherwise your sort could return odd results.

cheers, Pete
[ September 01, 2004: Message edited by: Pete Harris ]
17 years ago
That's the brute force approach, but it assumes all the objects implement the Comparable interface, which is probably valid otherwise they can't be sorted

The other approach is to consider one of the sorted collections such as the TreeMap or TreeSet which sort the data as it is entered and therefore it is always returned in it's natural sorted order. Whether or not you can use one of these classes depends on the design of your application.

cheers, Pete
17 years ago
I think the problem may be that you are using the javascript onSubmit() method incorrectly. It is designed to be a validation feature so you can check the entries in the form before submitting. If you return true from it then the form is submitted by the browser, if false it is not.

Therefore your call to form.submit() in the onSubmit method submits the form for the first time and when your function returns, the browser is submitting the form for the second time. Hence doGet is being called twice.

It's been a while since I did any javascript so I'm not 100% sure on this...

cheers, Pete
17 years ago
Dave,

Couple of things here. There's no reason the code you've written won't work (ignoring typos, that is ). Iterators are safe to run in tandem as long they don't actually change the underlying collection (for example by calling iterator.remove() method).

On the other hand, is there any reason you can't call the size() method directly on the collection to get it's size? That way you would only need one iterator.

cheers, Pete
17 years ago
Scott,

I think this makes sense. The rule you mention is simply saying that there can be no statements in a constructor before an explicit call to it's superclass constructor. Obviously with implicit calls such as you have here, you can't anyway because the call is made automatically before the first statement executes.

Therefore, what it's disallowing is:


which will produca a compile time error.

cheers, Pete
I just checked on the off chance they might have re-marked it (well, to be honest I've been checking at least twice a day since I sent the mail!). No e-mail from them as yet.
Bikash,
the problem here is that you've got a static variable 'file' which is not properly defined. What you need to do is make it a local variable created inside the zip enumeration, and change your main() method so that it defines it's own file variable. You should also close the zip file just before the end of the unzip() method.
I've run a quick test with these changes and it seems to work fine,
cheers, Pete
18 years ago
Just to let you know,'ve just rechecked the cert manager site and they've regraded the server to 48/53 so I passed.
I'm really impressed by Sun here. They're obviously open-minded about appeals and process them quickly (they dealt with this inside 3 days).
cheers, Pete
Billy,
It took about 2 weeks from taking the exam for the results to be posted, and failing-wise, I didn't even consider the possibility. I was (and still am) certain that it was fine
cheers, Pete
[ July 09, 2003: Message edited by: Pete Harris ]