Questions tagged [comparison]

Questions about data comparison and efficient ways to accomplish it. Please avoid using this tag for generic (meta) comparison of two issues or concepts.

Questions about data comparison and efficient ways to accomplish it, e.g.: "Which is the fastest algorithm to compare two recordsets and decide which one has more palindromes?", or "What is the fastest way to compare two strings and say if they have more than Y characters in common?"

There are generally six basic "comparison operators": less than, <; less than or equal to, <=; equal to, ==; not equal to, !=; greater than or equal to, >=; and greater than, >.

8118 questions
3
votes
3 answers

How can I convince my manager not to give up on MVC to get back to Web Forms?

I work in a company where, since I arrived, I had full freedom to use whatever Microsoft technology, pattern and tool in order to develop my applications. I started to develop all the applications with ASP.NET MVC3 and I currently have 5…
CiccioMiami
  • 8,028
  • 32
  • 90
  • 151
3
votes
2 answers

warning C4018: '<' : signed/unsigned mismatch?

This code throws a warning when I compile it under VS. if (m_nDarksideEffectAttCnt < m_DarkTargetIndex.size()) if (m_DuelWatchUserList.size() <= iIndex) Warning: & warning C4018: '<=' : signed/unsigned mismatch Any solutions?
jotajota
  • 57
  • 2
3
votes
3 answers

PyTorch: compare three tensors?

I have three boolean mask tensors that I want to create a boolean mask that if the value matches in three tensors then it is 1, else 0. I tried torch.where(A == B == C, 1, 0), but it doesn't seem to support such.
Minh-Long Luu
  • 2,393
  • 1
  • 17
  • 39
3
votes
3 answers

How to keep only the key-value-pair with the global max value over several dictionaries?

Input: A= [{'A':0.4, 'B':0.8, 'C':1.0}, {'A':0.5, 'B':0.9, 'C':0.0}] Desired Output: A=[{'C':1.0},{'A':0.5, 'B':0.9}] Note: I wanna iterate through and keep only the key with the maximum value among same keys !! And list of dictionaries should…
DataFlow
  • 33
  • 5
3
votes
2 answers

What is the most efficient way to rank the item of a list based on the preference of the user by showing two item at a time?

For some context, I recommend to watch this video from Tom Scott in which he determines what the best "thing" is : https://youtu.be/ALy6e7GbDRQ. I think it will help for the explanation of my question. Basically I am trying to make an…
Lewis
  • 45
  • 6
3
votes
4 answers

what is the difference between != and !== in Javascript?

Possible Duplicate: Javascript === vs == : Does it matter which “equal” operator I use? Are != and !== are respectively the same as == and ===?
ilyo
  • 35,851
  • 46
  • 106
  • 159
3
votes
4 answers

Check if each element of a tensor is contained in a list

Say I have a tensor A and a container of values vals. Is there a clean way of returning a Boolean tensor of the same shape as A with each element being whether that element of A is contained within vals? e.g: A = torch.tensor([[1,2,3], …
iacob
  • 20,084
  • 6
  • 92
  • 119
3
votes
4 answers

Comparing elements of numpy arrays in python

I want to compare two 1x3 arrays such as: if output[x][y] != [150,25,75] (output here is a 3x3x3 so output[x][y] is only a 1x3). I'm getting an error that says: ValueError: The truth value of an array with more than one element is ambiguous. Does…
Double AA
  • 5,759
  • 16
  • 44
  • 56
3
votes
4 answers

Comparing column values with rowSums

I'm trying to use rowSums but using a comparison on values for the condition. Here is an example of my data frame, based on surveys. Where rows refer to participants, columns to a date of birth of a child. b3_01 b3_02 b3_03 b3_04 b3_05 b3_06 1 …
3
votes
2 answers

Image Comparing and return Percentage

int DiferentPixels = 0; Bitmap first = new Bitmap("First.jpg"); Bitmap second = new Bitmap("Second.jpg"); Bitmap container = new Bitmap(first.Width, first.Height); for (int i = 0; i < first.Width; i++) { for (int j = 0; j < first.Height; j++) …
Rosmarine Popcorn
  • 10,761
  • 11
  • 59
  • 89
3
votes
3 answers

Compare values of two arrays - classic asp

How can I Compare values of two arrays to check if 1 array does not have an element of another array for example - array1(0) = 85 array1(1) = 459 array1(2) = 90 array2(0) = 459 array2(1) = 90 I want to return the values that are not present in…
kurupt_89
  • 1,542
  • 8
  • 37
  • 65
3
votes
2 answers

How does Pythons double-sided inequality work? and why doesn't it work for numpy arrays?

In Python you can do the following; >>> 3 < 4 < 5 True >>> 3 < 4 < 4 False How does this work? I would have thought that 4 < 5 would return a boolean, and so 3 < True should return False, or 3 < 4 should return a boolean and so True < 4 should…
Vinzent
  • 1,070
  • 1
  • 9
  • 14
3
votes
5 answers

Comparison of bmp files?

I want to compare two bmp files. I thought of two approaches: to compare the header as well as the information header of the two files convert the bmp file to binary and then do the above comparison But, I don't know how to start and which will…
tanvee
3
votes
3 answers

python comparison for trees represented as tuples

I'm representing trees with tuples. Say t1=(t2,t3) and t4=(t5,t6) Is it true that when comparing two such trees with ==, it first tests if references t2 and t5 are equal then if references t3 and t6 are equal, if they are not equal then it tries…
titus
  • 5,512
  • 7
  • 25
  • 39
3
votes
2 answers

Case (in)sensitive comparison with VB.NET LIKE operator in runtime (without Option Compare)

Is there anyway to use LIKE operator in VB.NET as case sensitive or insensitive during runtime? For example use a flag to do case sensitive or insensitive comparisons. Obviously this can be done by simple converting them into lower case and forcing…
dr. evil
  • 26,944
  • 33
  • 131
  • 201
1 2 3
99
100