Anil Giri

Greenhorn
+ Follow
since Jun 04, 2009
Merit badge: grant badges
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 Anil Giri

What are the major implications of the new iOS 4 features from the iPhone developer's point of view?
12 years ago
iOS
I am wondering what should we be using, retain or copy with class members? Is copy operation heavier than retain?
12 years ago
iOS
Yes, you need to have MobileMe account. It enables you push custom messages to the device, delete your data from the device and also locate it, all from the Mobile Me web account.

Refer this link for details: http://www.apple.com/mobileme/features/find-my-iphone.html
12 years ago
iOS
Hi,
I am using JavaMail API to send mail using Gmail Server.
The code runs fine from my Development environment, which is Eclipse using JRE 1.6 and JavaMail 1.4.3 and Tomcat 6.

But I build my code for using the compatibility option for Tomcat 5.5.
My production server has following specs.

Tomcat 5.5
JRE 1.4
JavaMail 1.4.3
Java Actication Framework 1.1.1

But there seems to be some issue with my JavaMail Setup. Though the mail.jar file and activation.jar file is in the Tomcat Lib.

Following is the debug log:

Any help would be appreciated.

12 years ago
Thank you very much Mr. Wong and Ritchie.
@Mr. Wong, I got the problem sir. But isn't it true that for the purposes of ensuring set property (i.e. uniqueness) the TreeSet will use the equals() function rather than the comparator.

Further, could someone suggest me a solution. I wish to avoid duplicates and keep the elements sorted on priorityOne>>PriorityTwo>>Name.
13 years ago
I am trying to creat a TreeSet of "Person" objects. I expect that no duplicates shall be allowed to be added and that the "persons" shall be automatically sorted on the criteria as defined in the Comparator:compare The code follows:


The output I get is as follows:


I am not able to figure out, why is this TreeSet allowing duplicate entries. As is evident, persons with same name e.g. T1or T3 must be treated as equal.
Please help me out.
13 years ago
Thanks sir!
That corrected it.

So that means the put method of the HashMap class does not copy the object to the map. It just links the object to the map value, so that the last value added the object persists.
13 years ago
I am trying to create a HashMap which string keys and HashSet of Strings as values. I wrote the following code for this.



The file cvtfile.txt has the following content:


The Output is:


I am not able to make out why is the value set that is read at last is getting mapped to all the keys.
I would be grateful for any comments/suggestions.
13 years ago