Questions tagged [compare]

1

votes
2

answer
31

Views

JMeter Assertion : Error when comparing variables

I am trying to assert my API response data with a value I obtained from my Database. My code fails to compare my variables unless I add toString() to both my variable. Is there any way around it or is toString() mandatory? The code in question is : Boolean comparision = false; for (int i; i < vars.g...
Adithya Balaji
1

votes
2

answer
42

Views

Compare lists in C# / Unity and ignore items

I am using Vuforia in Unity which has a built in script called DefaultTrackableEventHandler. It has a code like this; protected virtual void OnTrackingFound() { var rendererComponents = GetComponentsInChildren(true); foreach (var component in rendererComponents) component.enabled = true; } I have so...
Sara
0

votes
0

answer
27

Views

How to compare two HashMap if I have ArrayList?

I can not continue my HashMap homework. Can you help me? I have 2 HashMap: mtutors and mstudents. mtutors key: their name. mtutors value: a subject. mstudents key: their name. mstudents value: subjects(ArrayList) I have to find the matching tutor-students. For example: One of the mtutors key: Peter...
Dylan
1

votes
2

answer
6.4k

Views

How to compare two unsigned integers (uint8_t) in c

I have two uint8_t pointers in my program and I want to compare the values of those. I don't have good idea to deal with unsigned ints. Here is my code static void bacast_signed_message() { uint8_t *M = malloc(MAX_M_LEN*sizeof(uint8_t));//uint8_t M[MAX_M_LEN];//uint8_t *M; int M_len = MAX_M_LEN;; ui...
cdev
4

votes
2

answer
27

Views

SQL query Find all product which has increased value at certain 2 dates

I am wondering if I can do this using SQL query. I have a table called "data" which contains the product name, date and sale number. my table look like this: Product date Sale apple 1/1/2019 5 apple 2/1/2019 4 apple 3/1/2019 3 apple 4/1/201...
Max Cheung
1

votes
1

answer
780

Views

Python Comparing columns of 2 csv files and writing to a new csv

I have 2 csv files each with only 1 column as below: csv file 1 : adam3us.csv created_at 6/7/2018 19:00 6/6/2018 12:00 6/6/2018 9:00 6/6/2018 9:00 6/6/2018 5:00 6/5/2018 16:00 6/5/2018 7:00 6/4/2018 16:00 csv file 2 : Bitcoin Hourly Based created_at 1/8/2017 0:00 1/8/2017 1:00 1/8/2017 2:00 1/8/2017...
Stevi G
1

votes
1

answer
1.5k

Views

MySQL sum column and compare it to a given value

I need to display a set of result of available room from DB in which conditions are: alm_num = 1 alm_date between 26-29 Nov 2012 and sum_num > or = 3 Then I compose mySQL like this: select sum(villas_allotment.alm_num) as sum_num, villas_allotment.alm_id as aid, villas_db.v_name as vname from vil...
Wilf
1

votes
5

answer
4.1k

Views

Implement compare method of Comparator out of defining line

Generally I define Comparator as - Comparator comparator= new Comparator() { public int compare(Obj o1, Obj o2) { //implementation... } }; And when the Comaprator is a part of class memeber's it's slightly does not looks good on the code format . Is there any way to define the Comparator as Comp...
URL87
1

votes
3

answer
134

Views

PHP strings - if part of needle is found in haystack

I've tried searching for a solution online but have had no luck (i´m a PHP beginner). I have two strings (collection of phone numbers with a time-stamps) that have comma separated values. I need to check if a specific part of text between the commas from sting A can be found in string B. Here is an...
Skuli Axelson
1

votes
1

answer
331

Views

how does compiler know not to optimize statements from inside lock/unlock? using boost::spinlocks in c++

Class with two overloaded operator() functions are called from separate threads. See //comments in code below. Does the optimizer know not to move entryadd = mSpread * ENTRY_MULTIPLIER above the lock()? struct Algo1 { boost::detail::spinlock mSpreadLock; Algo1() : mSpreadLock() {} //called fro...
jaybny
1

votes
1

answer
762

Views

php in_array - needle is array, check if all elements in needle exist in haystack

Im starting to get no ideias to solve this or probably its more simples than i expecpt. Hope someone can help: Im try to verify if array A arrA = Array ( [0] => hindu [1] => inglês ) exists in array B arrb = Array ( [0] => active [1] => awsome [2] => speaker [3] => creative [4] => team leader [5]...
David Rosendo
1

votes
2

answer
690

Views

Compare similarity of two NSStrings

I would like to compare two NSStrings. If the user types "Stonehhengge", should get a "border on answer"="almost equals", because the right answer is: "Stonhenge". I would like a percentage of how much one string equals another. If "Stonhenge" is 9 letters, and the typed text contain 8 letters from...
incmiko
1

votes
3

answer
1.8k

Views

How can I 'translate' elements from a 'list' to those in another 'list' in Python?

Alright, I did a bit of researching before I came here, and I didn't find anything that catered especially to what I wanted to find. The problem is a little difficult, (at least, for me) so I'll do my best to explain it here. Ok: So I've got a list of letters, that are taken from a string a user e...
Micrified
1

votes
1

answer
1.6k

Views

C atomic operations, if writes are all atomic swaps do I need atomic load?

I am writing a program in C. FOR SIMPLICITY LETS SAY: There are several variables that many threads can both read and write. Every time one of these is written it is written via an atomic swap (GCC atomic operations, sync and swap). Do I need to use an atomic load every time I read one of these vari...
Exodist
1

votes
1

answer
8.9k

Views

Compare two tables with minus operation in oracle

Some tables' data need to be updated(or deleted , inserted) in my system. But I want to know which data are updated,deleted and inserted. So before the data are changed ,I will backup the table in different schema just like this: create table backup_table as select * from schema1.testtable and afte...
tousinn
1

votes
4

answer
1.2k

Views

How to get same index value from other array?

I have two arrays and i want to access data of same index value from other array. Two Array list : ArrayList Position = new ArrayList(); ArrayList List_Data = new ArrayList(); Now my Position array contains Integer value like index of data i.e 0,3,5 out of 10 Records. i want to get only those strin...
Chintan Khetiya
1

votes
2

answer
64

Views

PHP Smarter way of comparing a value, to a multidimensional not using foreach?

This is a quick one. Is there a way to compare a given value to a multidimensional array of preset rules, without looping through our rules? I'll give you an example. Let's say we are evaluating students from 1 to 10. And we want to assign a performance assessment with a few words. So we'd have rang...
Matt
1

votes
1

answer
457

Views

How to do XML canonical comparison with PostgreSQL?

I need to compare XML values with PostgreSQL 9.X. Example: SELECT 1 FROM t WHERE xml1=xml2; -- error for XML datatype but can do only with casting to text datatype, SELECT 1 FROM t WHERE xml1::text=xml2::text; -- OK, but is a text-comparison that is not the best way to do this. I need a better comp...
Peter Krauss
1

votes
2

answer
172

Views

Generic value and type comparer with operators

I have a business logic, base on the pre-defined condition (OperatorType and compare value), validate if it is true or false. The problem here is the value is "typed", and with operator (greater/less/equal etc). If ValueType is Integer, then the value and compare value need to converted to Integer f...
James
1

votes
3

answer
1.4k

Views

Increment values in an array with constraints using Matlab?

Scenario : If I have an array with 4 loads (a1 a2 a3 a4) a=[a1 a2 a3 a4] (locations of these loads must be fixed) a=[1 2 3 3] I would like to try and increase all values in the array to 3. Note : the array a is not fixed, and can have any value from 0:3 Constraints : There is a priority array th...
NLed
1

votes
1

answer
8.6k

Views

How to use jQuery to compare two values?

I'm trying to use jQuery to compare two values in an html table, and alert the user if quantity > inventory. I want to select values in the current row : JS $('.item_quantity').change(function(){ var $this=$(this); var quantity=$this.val(); // var inventory=$this.next('.item_i...
Kim
1

votes
3

answer
1.5k

Views

Compare a vector with selected element from a matrix

I want to compare a huge vector with selected element from a matrix in R. A is a matrix and B is a vector. I want to compare each element of B with selected element from A. C and D are selection criteria. They are vectors of same length as B. C specifies the row number of A, and D specifies the colu...
lionup
1

votes
2

answer
90

Views

How to check in java if 5<10>5<10 to n

How can I check for example from an array if 55 arr[j+1]) { System.out.println("ok!"); } } } For now I have this, but it's wrong.
user2417932
1

votes
2

answer
778

Views

Advantages and disadvantages of CAS programming [closed]

Can anyone give me a summary of the advantages and disadvantages of Compare And Swap programming ? (e.g. multi-core CPU performance) Here's and example in Java: /** * Atomically increments by one the current value. * * @return the updated value */ public final int incrementAndGet() { for (;;) { int...
MrROY
1

votes
2

answer
142

Views

Quickly discover differences between two SQL server databases

Is there a nice tool that allows for easy comparison between 2 Sql-Server databases ? For example, I'd like to do dev DB vs. live DB comparison to see what objects (view, stored procedures, tables ...) have been modified in dev. I know I can just run a script that compares system files, but I am ho...
David
1

votes
3

answer
2.5k

Views

Getting the old value and new value between two revisions with Hibernate Envers

This is a follow up question to Retrieve audited entities name, old value and new value of the given revision I have figured out how to get the two revision of an entity but don't see any easy to find the difference between the two. Is there anything in envers that will help doing a diff of an ent...
denov
1

votes
1

answer
3.7k

Views

Batch IF statement comparing variables

Say I have this batch file: ::Stuff set counter=1 set amount=10 :BEGIN ::More stuff set /a "counter+=1" if %counter% LEQ %amount% goto BEGIN ::END It is not continuing even when counter reach amount . What am I doing wrong? The reason I am not using a for loop is I need a variable to store the count...
user1023102
1

votes
7

answer
2.3k

Views

How to compare a value in javascript

I am getting data from some ajax operation, and trying to use javascript to do some conditional checks actually so when i print the response from the ajax like document.write(response) result [object Object] when i print something like document.write(JSON.stringify(response)) result {"status":"fail...
shiva krishna
1

votes
3

answer
4.1k

Views

Java replace string sequences ignoring case?

For a project, I've given a sequence that the program searches for and tries to find a sequence of letters. If it finds any, it makes those sequences capitalized and prints out the line. For instance in sequence bcdaaab when I run the program, and specify the string aa as what to find, what should...
Teddy Black
1

votes
3

answer
1.1k

Views

awk script: check if all words(fields) from one file are contained in another file

I am new to awk scripting. I want to do a field by word (field) comparison of two files File1.txt and File2.txt. The files contain a list of | (pipe) separated field. File 1: ------------------- aaa|bbb|ccc|eee|fff lll|mmm|nnn|ooo|ppp rrr|sss|ttt|uuu|vvv File 2: ------------------- aaa|bbb|ccc|eee...
user2804482
1

votes
1

answer
2.4k

Views

Compare URLs using PHP

I have the following 3 urls http://www.yahoo.co.uk and http://yahoo.co.uk, the difference being that the later doesn't have www in it. When using parse_url on both these url's, the output is the following. {"scheme":"http","host":"www.yahoo.co.uk"} {"scheme":"http","host":"yahoo.co.uk"} Both url's b...
Abishek
1

votes
3

answer
349

Views

C#: Comparing strings in a List<string> with string attributes in Objects in a seperate List<Object> using Obj.getName()

Im writing a program where I have a Deck of cards (MyDeck Object) which contains a list (List of type Card) within which are my cards (Card Objects). There is also a Magazine (Magazine Object) with a list of cards (List of type string) for sale. I want to add cards that are in the magazine to my dec...
Joel
1

votes
1

answer
98

Views

bash awk file compare

I have a config [LogicalUnit1] UnitInquiry "NFSN00Y5IP51ZL" LUN0 /mnt/extent0 64MB [LogicalUnit2] UnitInquiry "NFSN00N49CQL28" LUN0 /mnt/extent1 64MB [LogicalUnit3] UnitInquiry "NFSNBRGQOCXK" LUN0 /mnt/extent4 10MB [LogicalUnit4] UnitInquiry "NFSNE7IXADFJ" LUN0 /mnt/extent5 25MB which is rea...
user2888268
1

votes
3

answer
13.3k

Views

Comparing a column using the data of one column in the same table SQL

I have a table with two columns, name and numb. The first column contains a name and the second contains a number for that name. What I'm trying to do is output 3 columns, name, number, name, where the last name column is a name that contains the same number as the first name column. So the output w...
Delibrete
1

votes
1

answer
970

Views

atomic set bits in array of bytes

How do you atomically set bits of a byte? The problem I am trying to solve concerns updating a huge array of bytes, say uchar data[262144]. I am setting only 2 bits of a byte at one time using SET(index,value), which means four threads could be setting values in one byte simultaneously. It is very r...
danny
1

votes
3

answer
311

Views

Compare two lists to make them equal in elements

I have two lists named List1 & List2. Now say List1 & List2 has 5 elements {a,b,c,d,e}. Now if I remove {b,c} from List1 and add {f,g,h} to List1, how can i make List2 Equal(by doing add & remove operation on it.).
Murtaza Munshi
1

votes
1

answer
689

Views

Grab output of a command lines in linux bash unusual result

#!/bin/bash output=$(compare -subimage-search -metric mae large_image.png item.png result.png) echo "Output is: $output" It displays like something like this: 7216.53 (0.110117) @ 6,4 Output is: But I am expecting something like this Output is: 7216.53 (0.110117) @ 6,4 It seems to me that compare(im...
ivanceras
1

votes
3

answer
351

Views

compare 8bit value against 16bit value

I was wondering what happens when an 8bit value is compared against a 16bit value. I'll try to explain the problem by a code example: bool result; unsigned char a_8bit = 0xcd; unsigned short b_16bit = 0xabcd; result = a_8bit < b_16bit; Possible results can be: a_8bit is casted to unsigned short imp...
Timm
1

votes
1

answer
36

Views

How can I check for a new version of a locally hosted webpage?

I have a program written in HTML/jQuery that resides on a local machine that needs to notify the user of an update when one is released. I am thinking that the program can compare a local file (local_version.txt or something) to a remote file (remote_version.txt) and if the remote file contains a hi...
block14
1

votes
2

answer
704

Views

Comparing textbox.text to char c#

Just wondering if there is a way that I can compare the text in my textbox to a char without making a string to do it? My way seems a bit inefficient. It is 'a[i].Text' i am comparing to 'number', thanks in advance if you can help. private void a1calculate(char number) { bool plausible = true; for (...
Luke h

View additional questions