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
6 answers

String comparison in .NET

What is the difference (in bref) between (.NET) myString == otherString and myString.CompareTo(otherString) == 0
serhio
  • 28,010
  • 62
  • 221
  • 374
3
votes
4 answers

Are Java 6's performance improvements in the JDK, JVM, or both?

I've been wondering about the performance improvements touted in Java SE 6 - is it in the compiler or the runtime? Put another way, would a Java 5 application compiled by JDK 6 see an improvement run under JSE 5 (indicating improved compiler…
Adrian
  • 42,911
  • 6
  • 107
  • 99
3
votes
2 answers

How to obfuscate C++ variables and functions

I'm trying to do some algorithm comparison for plagiarism. I've found many TEXT comparison for plagiarism. But in an algorithm it's very different. Let's say that some algorithm uses an huge number of variables, functions and user defined…
IPValverde
  • 2,019
  • 2
  • 21
  • 38
3
votes
1 answer

A learning application for popular web frameworks, like TodoMVC

First of all, to the moderators, don't get angry if this is not the right place to post this :). I wondre if there is something like the TodoMVC for popular web frameworks like Django, Rails, Symfony and etc. If there is not something like this,…
Omid Kamangar
  • 5,768
  • 9
  • 40
  • 69
3
votes
2 answers

Large Array Comparison

I have ~25.000 distinct names in an SQL database, and would like to perform edit-distance comparison on all of these in order to normalize e.g. John Doe & Jhon Doe. When the db was only around 1000 names I used to store all distinct names in an…
Freek8
  • 694
  • 4
  • 11
  • 24
3
votes
5 answers

Cross compare ArrayList elements and remove duplicates

I have an ArrayList that may (or may not) contain duplicates of MyObject I need to remove from the List. How can I do this in a way that I don't have to check duplication twice as I would do if I were to iterate the list in two for-loops…
F.P
  • 17,421
  • 34
  • 123
  • 189
3
votes
5 answers

Simple way to compare a character in a position in a line to rest of lines at same position (Perl)

I have a file with a bunch of lines and want to compare to see if all the characters of a particular column match with the rest of the file in Perl. For example if I have a file: abcdefg avcddeg acbdeeg The file would read a, d, g as matches and…
urbanspr1nter
  • 1,347
  • 2
  • 16
  • 25
3
votes
9 answers

How do I choose a CMS/Portal solution for a small website(s)?

I currently maintain 3 websites all revolving around the same concept. 2 of them are WinForms applications where the website gives a few basic details, and download links. The third is a web application to query data. I also have a forum…
Dillie-O
  • 29,277
  • 14
  • 101
  • 140
3
votes
6 answers

custom smart pointers and polynomial number of comparison operators

Lets say I want to implement a smart pointer a_ptr which can be compared with other smart pointers. Then I need to implement all permutations of the comparison operators: template bool operator==(const a_ptr& a, const a_ptr&…
ronag
  • 49,529
  • 25
  • 126
  • 221
3
votes
4 answers

compare string contents in haskell

I have a 2 lists of strings eg: listx = ["name","age","rank"] input = ["name","age"] How can I compare the two lists to check whether the listx contains "name" & "age" given in input?
pier
  • 503
  • 3
  • 14
  • 29
3
votes
1 answer

Using Guava's ComparisonChain to compare strings containing roman numbers

I have class implementing Comparator which should sort strings in such manner that strings with first word being roman number should be before string that don't begin with roman number, and if both strings begin with roman literal, there…
Grzegorz Rożniecki
  • 27,415
  • 11
  • 90
  • 112
3
votes
1 answer

Type-Incomplete Matlab Equality Support

Why can't I compare specific types such as, function handles, using the == operation in Matlab? For instance @prod == @sum fails with error Undefined function 'eq' for input arguments of type 'function_handle'. Does this mean that this type can…
Nordlöw
  • 11,838
  • 10
  • 52
  • 99
3
votes
2 answers

javascript how to sort strings containing comma separated values

I would like to know how can I sort strings in javascript containing comma separated values in different order e.g. var str1 ="aaa,SC,AAA,mc,mc,aaa"; var str2 ="AAA,SC,aaa,aaa,mc,mc"; So basically i want to sort them and do an equality…
Nomad
  • 1,092
  • 11
  • 29
  • 42
3
votes
1 answer

There is a way to generate some kind of a hash of a text to comparison?

I don't know if what I want is possible, but is this: Suppose I have a few phrases, I want to generate some kind of fewer string of that phrase that can represent the text. I will apply this for a lot of texts. After that, I compare the resulting…
Renato Dinhani
  • 35,057
  • 55
  • 139
  • 199
3
votes
1 answer

Verifying equality of Collection with Mockito?

I'm using Mockito for my unit testing, and I've run across an issue where I have a collection of hashes, and I want to verify that the parameters were equivalent. i.e. I have something like Collection< byte[] > blobs = new ArrayList< byte[] >(); //…
Shawn D.
  • 7,895
  • 8
  • 35
  • 47