Questions tagged [compare]

The analysis required to assess the differences and similarities between two or more entities.

This tag is used to classify a question as one dealing with the comparison of at least two entities. The essence of questions that are tagged should boil down to one of the following questions:

  1. How do I control when the compiler/interpreter thinks that two entities are equal? How do I control when the compiler/interpreter thinks that two entities are unequal?
  2. How do I control when the compiler/interpreter thinks that one entity is bigger than the other?
  3. How do I control when the compiler/interpreter thinks that one entity is smaller than the other?

Note that in some languages, it is possible to define asymmetric inequalities. That is, cases in which a<b does not mean that b<a. This is why in python, there exist separate functions for __gt__ (greater than) and __lt__ (less than), etc

9183 questions
47
votes
1 answer

Compare 2 JSON objects

Possible Duplicate: Object comparison in JavaScript Is there any method that takes in 2 JSON objects and compares the 2 to see if any data has changed? Edit After reviewing the comments, some clarification is needed. A JSON object is defined as…
user356808
47
votes
4 answers

Mysql Compare two datetime fields

I want to compare two dates with time, I want all the results from tbl where date1 > date2 Select * From temp where mydate > '2009-06-29 04:00:44'; but it is just comparing dates not time. it is giving me all the result set of today's…
MySQL DBA
  • 5,084
  • 18
  • 48
  • 69
46
votes
9 answers

Image comparison algorithm

I'm trying to compare images to each other to find out whether they are different. First I tried to make a Pearson correleation of the RGB values, which works also quite good unless the pictures are a litte bit shifted. So if a have a 100% identical…
honeymoon
  • 1,712
  • 4
  • 28
  • 32
44
votes
1 answer

AngularJS vs ReactJS

I am deciding which JavaScript framework to use for my new web application. I wanted to use Angular, but recently heard about React. The problem is - I have not found a really good comparison between the both. Most of the articles which do a…
Asped
  • 2,993
  • 3
  • 28
  • 51
43
votes
5 answers

An easy way to diff log files, ignoring the time stamps?

I need to diff two log files but ignore the time stamp part of each line (the first 12 characters to be exact). Is there a good tool, or a clever awk command, that could help me out?
Teflon Ted
  • 8,250
  • 17
  • 59
  • 76
42
votes
6 answers

How to compare Unicode strings in Javascript?

When I wrote in JavaScript "Ł" > "Z" it returns true. In Unicode order it should be of course false. How to fix this? My site is using UTF-8.
Tomasz Wysocki
  • 9,948
  • 5
  • 42
  • 62
42
votes
12 answers

Is there an open source SQL Server DB compare tool?

I'm working on an open source project that uses SQL Server 2005 as the data store. We need a DB compare tool to generate diff scripts to be able to upgrade a DB from one version to another. Is there an open source or free SQL Server DB diff tool out…
Guy
  • 59,547
  • 93
  • 241
  • 306
41
votes
5 answers

What is the benefit of using Spring REST Docs comparing to Swagger

Spring REST Docs was released recently and the documentation says: This approach frees you from the limitations imposed by tools like Swagger So, I wanted to ask when Spring REST Docs is preferable to use comparing to Swagger and which limitations…
evgeniy44
  • 2,442
  • 6
  • 24
  • 45
41
votes
3 answers

How to compare time part of datetime

Let's say we have DateTime t1 = DateTime.Parse("2012/12/12 15:00:00.000"); and DateTime t2 = DateTime.Parse("2012/12/12 15:03:00.000"); How to compare it in C# and say which time is "is later than"?
DmitryBoyko
  • 32,983
  • 69
  • 281
  • 458
39
votes
6 answers

How to compare two date values with jQuery

I have two String fields which represent Dates in my page and I would like to compare these two fields to know if my first date < second date. How can I do this? First Date:
Mercer
  • 9,298
  • 27
  • 91
  • 154
38
votes
6 answers

Comparing 2 lists consisting of dictionaries with unique keys in python

I have 2 lists, both of which contain same number of dictionaries. Each dictionary has a unique key. There is a match for each dictionary of the first list in the second list, that is a dictionary with a unique key exists in the other list. But the…
alwbtc
  • 23,407
  • 50
  • 123
  • 177
38
votes
6 answers

Git: Compare All Local Commits to Remote Repo Version

I'm somewhat new to Git and what I'm trying to do seems like it should be possible. Basically I've been working off of clone of a repo and have made quite a few local commits. Is there a way to see the diff of the 'sum' of all my changes and the…
Ian Dallas
  • 11,281
  • 18
  • 55
  • 80
38
votes
3 answers

How to compare Enums in Python?

Since Python 3.4, the Enum class exists. I am writing a program, where some constants have a specific order and I wonder which way is the most pythonic to compare them: class Information(Enum): ValueOnly = 0 FirstDerivative = 1 …
Sebastian Werk
  • 1,204
  • 2
  • 13
  • 27
38
votes
3 answers

Python - Use 'set' to find the different items in list

I need to compare two lists in Python, and I know about using the set command to find similar items, but is there a another command I could use that would automatically compare them, instead of having to code for it? I would like to find the items…
RPiAwesomeness
  • 4,319
  • 6
  • 30
  • 46
38
votes
11 answers

How to compare two tarball's content

I want to tell whether two tarball files contain identical files, in terms of file name and file content, not including meta-data like date, user, group. However, There are some restrictions: first, I have no control of whether the meta-data is…
myjpa
  • 383
  • 1
  • 3
  • 7