I am java programmer. There is concept of HashSet in Java that don't add duplicate elements in a Set. What is the similar concept in iPhone that do same ?  Please hint.  Thanks in advance.
121226
HashTables/HashMaps are one of the most (if not the most) useful of data-structures in existence.  As such, one of the first things I investigated when starting to learn programming in Cocoa was how to create, populate, and read data from a hashtable.  To my surprise: all the documentation I've been reading on Cocoa/Objective-C programming doesn't seem to explain this much at all.  As a Java developer that uses "java.util" as if it were a bodily function: I am utterly baffled by this.  So, if someone could provide me with a primer for creating, populating, and reading the contents of a hashtable: I would greatly appreciate it.
65595
Not quite an Attribute, not quite a Method. Stereotypes? &lt;&lt;get&gt;&gt; &lt;&lt;set&gt;&gt;?    I'm retro-modelling an existing system, so I need to clearly reflect that this is not the same as a readonly field or a methods pair (regardless of what the IL says), so I think I'll go with the stereotype, but I'll accept the language independant get_ set_ as a general solution. Thanks all for the sanity test.
113672
For example:  &gt;&gt;&gt; x = [1, 1, 2, 'a', 'a', 3] &gt;&gt;&gt; unique(x) [1, 2, 'a', 3]   Assume list elements are hashable.  Clarification: The result should keep the first duplicate in the list. For example, [1, 2, 3, 2, 3, 1] becomes [1, 2, 3].
7764
Why is the following true?  $$\{ \emptyset \}  \neq \emptyset $$  Is it just because the Empty set already refers to there being a set present and so it is just the same argument that $\{ \{3\} \} \neq \{ 3\} $?  And is there a proof for the following?   For any set$\, X$,   $$X \cup \emptyset = X \quad \text{and} \quad X \cap \emptyset = \emptyset$$
122243
If the empty set is a subset of every set, why it isn't written with the elements of a set? like so $\{1,2,3,\emptyset\}$   Or why isn't $\{\emptyset,\{a\}\}=\{\{a\}\}$? I know one has two elements and the other has 1 but since the empty set is a subset of both, then why it isn't being mentioned explicitly in the definition of the set?
20559
This question was inspired by the question on .  From the discussion in the comments there, it seems there does not exist a set of all sets of a given cardinality.  To me, it seems easy to see that this is true for any nonzero finite cardinality $n$. Given any set $x$, you can always make a set of size $n$ by adding $n-1$ other sets to $x$ to make a set of size $n$, which exists by repeated use of the pairing axiom.   But how would you do this for infinite cardinalities? For suppose $\kappa$ is some given infinite cardinality. To show that the set of all sets of cardinality $\kappa$ does not exist, it seems you would have to show that for any set $x$, there exists a set of that size with $x$ as an element, and then you could take the union of that set to find the set of all sets, and thus a contradiction. But it doesn't seem reasonable to simply say, for a given set of size $\kappa$ if $x$ is in the set, we have no problem. If not, just take an element out of the set and put $x$ in. Something about that seems like it would not be allowed.  So how would you do this for infinite cardinalities?
56405
I have came across this in a textbook:     $\{2\}\nsubseteq\{\{2\}\}$ but $\{2\}\in\{\{2\}\}$   I understand that $\{2\}$ is an element (member) of the other set but considering $\{2\}$ is a set itself, why is it not a subset?
11800
A strict equality operator will tell you if two object types are equal. However, is there a way to tell if two objects are equal, much like the hash code value in Java?  Stack Overflow question  is similar to this question, but requires a more academic answer. The scenario above demonstrates why it would be necessary to have one, and I'm wondering if there is any equivalent solution.
53155
Anyone have a good rule of thumb for choosing between different implementations of Java Collection interfaces like List, Map, or Set?  For example, generally why or in what cases would I prefer to use a Vector or an ArrayList, a Hashtable or a HashMap?
90529
$S(n, k)$ count the number of ways to partition a set of $n$ elements into $k$ nonempty subsets. What if there were duplicate elements in the set? That is, the set is a ?
101843
Take for example the set $X=\{a, b\}$. I don't see $\emptyset$ anywhere in $X$, so how can it be a subset?
32368
How to check if the content of a NSString is an integer value? Is there any readily available way?  There got to be some better way then doing something like this:  - (BOOL)isInteger:(NSString *)toCheck {   if([toCheck intValue] != 0) {     return true;   } else if([toCheck isEqualToString:@"0"]) {     return true;   } else {     return false;   } }
16236
Do you know some neat Java libaries that allow you to make cartesian product of two (or more) sets?   For example: I have three sets. One with objects of class Person, second with objects of class Gift and third with objects of class GiftExtension.  I want to generate one set containing all possible triples Person-Gift-GiftExtension.  The number of sets might vary so I cannot do this in nested foreach loop.  Under some conditions my application needs to make a product of Person-Gift pair, sometimes it is triple Person-Gift-GiftExtension, sometimes there might even be sets Person-Gift-GiftExtension-GiftSecondExtension-GiftThirdExtension, etc.
87341
An array is defined to be maxmin equal if it contains at least two different elements and the number of times the maximum value occur is the same as the number of times the minimum value occur. So {11, 4, 9, 11, 8, 5 , 4, 10} is maxmin equal, because the max value 11 and min value 4 both appear two times in the array.   if the input array is {} , isMaxMinEqual should return false (array must have at least two different elements) status = false; if the input array is {2}, isMaxMinEqual should return false (array must have at least two different elements). if the input array is {1,1,1,1,1,1}, isMaxMinEqual should return false (array must have at least two different elements).  if the input array is {2,4,6,8,11}, isMaxMinEqual should return true (Both max value(11) and min value 2 appear exactly one time). if the input array is {-2,-4,-6,-8,-11}, isMaxMinEqual should return true(Both max value(-2) and min value -11 appear exaclty one time).   I wrote the class MaxMin which satisfied the above condition.  public class MaxMin {  public static void main(String args[]) {     System.out.println("The result is: " + isMaxMinEqual(new int[]{2, 2})); }  public static boolean isMaxMinEqual(int[] a) {     boolean status = false;     int count = 0;     if (a.length &lt; 2) {         status = false;         return status;     }     for (int i = 1; i &lt; a.length; i++) {         if (a[i - 1] != a[i]) {             count++;         }     }      int max = a[0];     int min = a[0];     for (int i = 0; i &lt; a.length; i++) {         if (a[i] &gt; max) {             max = a[i];         } else if (a[i] &lt; min) {             min = a[i];         }     }      int maxCount = 0;     for (int j = 0; j &lt; a.length; j++) {         if (a[j] == max) {             maxCount++;         }     }      int minCount = 0;     for (int j = 0; j &lt; a.length; j++) {         if (a[j] == min) {             minCount++;         }     }     System.out.println(count);     System.out.println("max is: " + max);     System.out.println("min is: " + min);     System.out.println("Max Count is: " + maxCount);     System.out.println("Min Count is: " + minCount);      if (maxCount == minCount &amp;&amp; count &gt;= 1) {         status = true;     }      return status; } }
11978
We are given two numbers $a,b$ such that $a&lt;b$. Now we have a set $\{a,a+1,a+2,\ldots, b\}$ (all number between a and b including them). Then, we have to find how many numbers cannot be formed from the above set. The only operation allowed on the set elements is addition.    Note : We can add these number as many times we want. Only addition allowed on these numbers.  Eg : If numbers are 3 and 5, the set is $\{3,4,5\}$ using these we only cannot make $1,2$.  Can anyone help me with that?  I am not getting any idea. I tried the cases when $b-a = 1$.
66192
Let n be an even integer. How many different ways can I choose subsets of the set {1,2...,n} if they all have to have odd size, but the intersection of any two of them has to have even size?  Please help me answer this question or lead me in the right direction. Thank you :)
119153
Let $n \ge 1$ be an integer. Use the Pigeonhole Principle to prove that in any set of $n + 1$ integers from $\{1, 2, . . . , 2n\}$, there are two integers differ by one. I've attempt and come up with this: Let S be $\{1,2,...,2n\}$, $T_0$ be a subset of S with $n$ elements, $T_1$ is a subset of S with $n+1$ elements. We form $T_1$ by adding a number to $T_0$. If $T_0$ already has two integers differ by one, then we're done. If $T_0$ has no integers differ by one, how do we know $T_1$, having 1 more number, has two integers differ by one?