Most voted "comparison" questions
Used to compare different types (compare variables, objects, files, etc).
Learn more…155 questions
Sort by count of
-
2
votes1
answer173
viewsArraylist Comparator JSP Object
I’m having trouble implementing the Comparator method, to sort the Object Arraylist. I have an Enterprise class. Where I then create an Arraylist, which is filled from a content manager system. I…
-
2
votes2
answers428
viewsMultiple sorts with Arraylist
I have a question. I want to order the Arraylist person in different ways. <%@ page import= "java.util.*"%> <%! public class Pessoa implements Comparable<Pessoa> { String Nome;…
-
2
votes1
answer413
viewsTesting if a String is inside a File. txt
Hello I’d like to know how I compare a user-typed string with the strings contained in a file. txt My last attempt was like this , but I did not get the result I wanted: f = open("Testando.txt","r")…
-
2
votes1
answer195
viewsSearch text in a String as a "like"
I want to do a text search, like the ones I do in Mysql. Ex: LIKE "9%4" I tried to implement a find_if(), but without success. #include <iostream> #include <string> #include…
-
2
votes1
answer46
viewsComparing a data entry to a list, regardless of whether the word starts with a capital letter
I would like to know how to perform this comparison without taking into account if the month typed is capitalized or lowercase, since the program only works if you type in lowercase. prompt =…
-
2
votes3
answers16313
viewsComparison of char in C
I need to find out if each element of a chained list is a vowel or not. How can I fix my code? int BuscaNv(LISTA* resp){ NO* atual = resp->inicio; while(atual){ if(atual->letra == 'a' || 'e'…
-
2
votes1
answer96
viewsQuery - Comparison of Distinct Bases with equal columns
How would a query that selects between two tables according to the value of a specific column ? For example: I have two tables that contain account number and Balance, I need to know which accounts…
-
2
votes3
answers8565
viewsCompare 2 arrays and save the difference between them in the database?
I have 2 object arrays, one of them is composed of emails that comes from the provider through IMAP protocol and I convert to objects and then put in an array all of it. The other is an array of…
-
2
votes7
answers4295
viewsWhat does it mean Does the solution make comparisons against strings in the following code? JS
The statement of the financial year is: Declare the dayFew you receive a "Sunday" string. Then implement a conditional using if that compares diaDemana is equal to "Sunday", if true print a string…
-
2
votes2
answers458
viewsSort a java List containing null values
Good morning! In my List, when I do the ordering I would like the null values to be last. I’ll show you an example to make it clear: Code output (in this case the word would be the letter after the…
java list arraylist comparison collectionasked 6 years, 10 months ago Carlos Rafael de Oliveira Carn 50 -
2
votes2
answers1740
viewsComparing datetime with minutes interval
I need to compare 2 dates, these dates are in format %d/%m/%Y %H:%M:%S and one is obtained through the internet, and the other locally, however I am not able to compare the two with an interval of 2…
-
2
votes1
answer105
viewsString comparison gone wrong - Python
I have this function that checks if the code I typed is in the code list, but even though the code is in the list it does not enter if and returns false. I can’t understand why it doesn’t work.…
-
2
votes2
answers377
viewsGame of popping polka dots on the screen
I only posted the JS, I think it’s enough, I’m still new to JS and programming so I know almost nothing of the commands, I want to compare the position of the balls and the area they appear so that…
-
1
votes3
answers517
viewsComparing matrices of different sizes in R
I have the following situation : all_sec = Matrix of all possible assets in a portfolio all_sec <- matrix(c("SEC1","SEC2","SEC3","SEC4","SEC5"),ncol=1) portfolio <- composition of a portfolio…
-
1
votes1
answer278
viewsPage of product comparison
I created a page where I first make a choice on a select/list (musical genre), then depending on the choice appears the second select/list (music) with options related to the genre. What I need is…
-
1
votes2
answers1274
viewsCompare properties of an object with properties of a list
I have a method: public void MetodoAleatorio(List<RequisicaoFisicaDTO> lstRequisicaoFisicaDtos) { RequisicaoFisicaDTO requisicao = lstRequisicaoFisicaDtos.FirstOrDefault(); } Where I get a…
-
1
votes1
answer333
viewsComparison of an edttext with an Sqlite Bank value
I’m developing an application on android but do not know how to prevent the user register two equal times. Bench: String sql4 ="CREATE TABLE "+TABELAAGE+"(" +IDAGE+ " integer primary key…
-
1
votes2
answers1151
viewsHow to compare database data and display to user
I’m developing a surf site. In it, there’s a section called My Ideal Surfboard. Where the user will enter their data (Nome, email, peso, altura and experiencia(beginner, intermediate or advanced)).…
-
1
votes1
answer163
viewsWhy deploy with PHP is simpler?
I have the following question, because deploy with PHP is simpler than with other languages like PYTHON or RUBY? I know there are many Stacks ready, but when it is to move up such an application in…
-
1
votes1
answer5038
viewsCheck file date and time and keep the most current in Batch
I need a program in Batch where I will specify two files, it will compare the date and time of their creation and if the first is more current it would delete the second and copy the first,…
-
1
votes3
answers174
viewsJava Strings Comparison Error
I have the following situation. I get a string that is in the application’s localStorage in a javascript variable. <script> var sendForm = localStorage.getItem('f'); </script> This same…
-
1
votes1
answer111
viewsDouble factor in r with letters for differentiation
Dear friends, I’m trying to perform a double factor analysis or two-away Anova. I would like to know how to generate the letters of differentiation between treatments for the two factors. This…
-
1
votes1
answer395
viewsC# String.Contains() does not work, not even string search derivatives
I have a method in my code that looks for a person’s name inside a string but always returns false. Even when the name exists inside the string. What is totally inexplicable. I tried using Contains…
-
1
votes1
answer155
viewsSmallint or int to PK / Primary Key / Primary key?
In languages such as Java, for example, when processing a short int and comparing it with another short int, both are transformed into int. The same occurs in databases like Mysql?
-
1
votes2
answers1119
viewsHow to compare part of strings in C?
I can only compare two strings in full in C, but can I compare only part of a string? I wanted to develop a program that reads excerpts from a complaint and based on these excerpts give a response…
-
1
votes1
answer303
viewsError when comparing an Edittext to a String
I am trying to compare the text inserted in an Edittext with an item in my Arraylist, but the condition is never true. int aux=-1; for (int i = 0; i < lista2.size(); i++) { if…
-
1
votes1
answer738
viewsComparison of char type variables
I’m developing a program that needs to read a variable in char and compare the same with another char. However, when performing the comparisons using the function strcmp(typed_pass, correct_pass),…
-
1
votes3
answers2769
viewsHow to know if the chosen date is less than the current date?
I need to issue an Alert if the chosen date is less than the current date. I did so: var strData = "15/08/2017"; var partesData = strData.split("/"); var data = new Date(partesData[2], partesData[1]…
-
1
votes2
answers1174
viewsData Comparison in Files [C]
I want to make an algorithm that takes a name in an X file and see if this name exists in another Y file, if it does not exist it writes that name in a third Z file. (Basically an algorithm that…
-
1
votes2
answers126
viewsTake over positions of an array after comparison with another array?
I have a function (in Javascript) that compares 2 arrays: let diferencas = []; let numD = 0; for (let a = 0; a < dados.length; a++) { if (dados[a].idEmail === results[a].idEmail) {…
-
1
votes1
answer775
viewsIs there a possibility to compare schema between different databases in SQL Server?
I have several different comics, and I need to compare their Schemas, but doing this manually can go unnoticed. For context I will use database of smaller proportion than work. Image here. As you…
-
1
votes1
answer140
viewsHow to get the percentage of similarity between strings?
What is the best way to compare the level, or percentage of likeness between two strings using Javascript or Typescript? Example: string1 = "Este grupo é muito util para crescer profissionalmente e…
-
1
votes0
answers39
viewsHow to create a column based on another dataframe?
I would like to know how to create a column on a dataframe based on the code of another Python dataframe. For example, I have: df A: letra c b d c a df B: letra codigo a 10 b 20 c 30 d 40 Expected…
-
1
votes2
answers766
viewsCompare php texts
I need to develop/use a function to compare the text in two versions, to check what has been removed/added/maintained. One version I upload an html file and extract the plain text, and the other…
-
1
votes1
answer6191
viewsCheck if Arraylist has identical items
I have the class Pessoa: String Nome, Cidade; public Pessoa(String Nome, String Cidade){ this.Nome = Nome; this.Cidade = Cidade; } public String getNome() { return Nome; } public String getCidade()…
-
1
votes2
answers482
viewsError comparing strings
I need to make a program that takes a sentence, then a letter, and returns how many times the letter appears in the sentence. So I did this: import java.io.BufferedReader; import…
-
1
votes1
answer626
viewsSort string containing letters and numbers
I have a list of objects that has an integer and a String (composed of letters and numbers). I would like to sort by that integer and as a second clause the alphabetical/numerical order of the…
-
1
votes2
answers160
viewsComparison between Dictionary and List
I’m doing a show where the idea is to start by asking if the person is already registered, otherwise they go through one. I’m having trouble checking if the username is already existing, based on a…
-
1
votes0
answers352
viewsHow to compare values within a single vector? IN C
I made my code as follows, as placed below. However, if I put 2 repeated numbers it says it has only 1 repeated number, if I put 4 repeated numbers, it says it has 6 repeated numbers.I no longer…
-
1
votes1
answer80
viewsClass that implements Comparable must compare by a String field in lexicographic order
How do I order a list of people by name? For understanding, follow the code: public class Pessoa implements Comparable<Pessoa> { private String nome; private int idade; private String sexo;…
-
1
votes0
answers31
viewsDijkstra Algorithm with Priority Queue - Why and Poll are not working, is my logic wrong?
I’m trying to apply the algorithm of Dijkstra using Priority Precise to leave it with logarithmic complexity T(N) = E*log(n) The first node manages to find its neighbors and relax its values but the…
-
1
votes1
answer90
viewsThe loop of choice must end or continue in a menu
I have two objects that receive parameters by the standard system entry, but when the user chooses to continue or exit, the loop does not obey the output and when obeying the output does not obey…
-
1
votes0
answers60
viewsWhy does Nan === Nan return false in Javascript?
In Javascript, when comparing two values NaN (Not-A-Number), the result is false. However this does not occur with values like null and undefined. console.log(NaN === NaN, null === null, undefined…
-
0
votes1
answer48
viewsInclude in the email only the dates that are about to end
I’m preparing an email to send, but I just want to include in it the dates that are to end within X days. At present I have so: while ($row = mysql_fetch_array($validade)) { $id = $row[0]; $Nome =…
-
0
votes1
answer88
viewsDoubt in the comparison of variables
There is another way to develop this comparison? $numero = 1234; $a = 1111; $b = 2222; $c = 3333; $d = 4444; if ($numero == $a or $numero == $b or $numero == $c or $numero == $d) { echo "O número…
-
0
votes2
answers1324
viewsCompare files with PHP
Is there any tool or way to create a file comparison with PHP? Would you like something similar to Beyond Compare but within the Navigator. We have an application change control system that we…
-
0
votes1
answer1060
viewsC/C++ - Error comparing char with strcmp()
I need help, I’m having problems comparing two variables using strcmp(). [Error] invalid Conversion from 'char' to 'const char*' [-fpermissive] struct transicao{ int estado; //estado em que o DFA…
-
0
votes1
answer71
viewsComparing char variable in C
#include <stdio.h> #include <string.h> #include <stdlib.h> int main() { struct cmd1 { char cmd[20]; }; struct cmd1 cmdd; char cmd_ti[3] = "ti"; char cmd_tela1[2] = "a";…
-
0
votes2
answers510
viewsVector Comparison Problem - Java
I have a problem with a simple code in Java, I just started learning the language. The exercise consists of comparing the values of the vector to see if there are repeated elements. The problem is,…
-
0
votes1
answer384
viewsCompare rows of matrices with different dimensions and return a single logic vector
I have two coordinate matrices, matrix A with 83213 rows and two columns (longitude, latitude) and matrix B with 46886 rows and two columns (longitude, latitude). I would like to compare the…