Top "Equality" questions

Equality is a relationship between two or more items or variables or objects that exists if (1) the items are the same item, variable, or object or (2) the items are different items, variables or objects but they have the same value.

Comparing two collections for equality irrespective of the order of items in them

I would like to compare two collections (in C#), but I'm not sure of the best way to implement this …

.net collections comparison equality
LINQ Select Distinct with Anonymous Types

So I have a collection of objects. The exact type isn't important. From it I want to extract all the …

c# linq distinct anonymous-types equality
Best practices for overriding isEqual: and hash

How do you properly override isEqual: in Objective-C? The "catch" seems to be that if two objects are equal (as …

objective-c equality
double equals vs is in python

I run the following in the Python interpreter: >>> foo = 10 >>> dir(foo) == dir(10) True >&…

python comparison boolean equals equality
Checking if two Dates have the same date info

How can I check if two different date objects have the same date information(having same day, month, year ...)? I …

javascript date equality
In Objective-C, what is the equivalent of Java's "instanceof" keyword?

I would like to check whether an object (e.g. someObject) is assignable (cast-able) to a variable of another type (…

objective-c types casting equality downcast
Why is this code throwing an InvalidOperationException?

I think that my code should make the ViewBag.test property equal to "No Match", but instead it throws an …

c# asp.net-mvc exception equality invalidoperationexception
Compare if two dataframe objects in R are equal?

How do I check if two objects, e.g. dataframes, are value equal in R? By value equal, I mean …

r dataframe compare equality
Test for equality among all elements of a single vector

I'm trying to test whether all elements of a vector are equal to one another. The solutions I have come …

r vector equality
Using the equality operator == to compare two strings for equality in C

int main (int argc, **argv) { if (argv[1] == "-hello") printf("True\n"); else printf("False\n"); } # ./myProg -hello False Why? I …

c string pointers equality equality-operator