compare

Which is the best and fastest way to compare two urls?

Hello, I have two tables with list of urls fetched from different sources. I want to find the common entries and put them in separate table. This is what I'm doing: find md5 hash of url while fetching them. Store them in a column. I fetch one table as an array, run a loop through it and insert the values from other table where md5...

Folder Comparsion

Hi, I have two folders with sub folders. One folder is base folder other one is local folder These folders & subfolders consist identical as well as non identical files. I want compare these folders and report the result in some other file This report must consist of 1. List of All identical files 2. List of All modified files 3. List ...

Compare NSArray with NSMutableArray adding delta objects to NSMutableArray

I have an NSMutableArray that is populated with objects of strings. For simplicity sake we'll say that the objects are a person and each person object contains information about that person. Thus I would have an NSMutableArray that is populated with person objects: person.firstName person.lastName person.age person.height And so on. ...

Word comparing and replacing

Hi friends, I need some comparing and replacing code in PHP Our mission is to empower consumers to Praise Good Service when they receive it and to Report Poor Service wherever they have to endure it. I need this paragraph to xcompare for some words (for example mission, Good ) and replace that word like this m***n and G**d ...

How would you compare jQuery objects?

So I'm trying to figure out how to compare two jQuery objects, to see if the parent element is the body of a page. here's what I have: if ( $(this).parent() === $('body') ) ... I know this is wrong, but if anybody understands what I'm getting at, could they point me towards the correct way of doing this? ...

Button to add value to array and then compare result with another array on IPhone.

I have ten buttons that each correspond to a different number. I'm looking to record the order that these buttons are pressed and enter them into an array and then compare it to another array that is static in the app. The check should be done on the Nth button press, where N equals the number of items in the other, static array. How do...

C#/Java: Proper Implementation of CompareTo when Equals tests reference identity

I believe this question applies equally well to C# as to Java, because both require that {c,C}ompareTo be consistent with {e,E}quals: Suppose I want my equals() method to be the same as a reference check, i.e.: public bool equals(Object o) { return this == o; } In that case, how do I implement compareTo(Object o) (or its generic ...

PHP Compare Two Arrays?

I'm trying to compare two entries in a database, so when a user makes a change, I can fetch both database entries and compare them to see what the user changed, so I would have an output similar to: User changed $fieldName from $originalValue to $newValue I've looked into this and came accross array_diff but it doesn't give me the outp...

C# - How to implement multiple comparers for an IComparable<T> class?

I have a class that implements IComparable. public class MyClass : IComparable<MyClass> { public int CompareTo(MyClass c) { return this.whatever.CompareTo(c.whatever); } etc.. } I then can call the sort method of a generic list of my class List<MyClass> c = new List<MyClass>(); //Add stuff, etc. c.Sort(); ...

what are the advantages of C# over Python

I like Python mostly for the great portability and the ease of coding, but I was wondering, what are some of the advantages that C# has over Python? The reason I ask is that one of my friends runs a private server for an online game (UO), and he offered to make me a dev if I wanted, but the software for the server is all written in C#. ...

GCC problem with raw double type comparisons

I have the following bit of code, however when compiling it with GCC 4.4 with various optimization flags I get some unexpected results when its run. #include <iostream> int main() { const unsigned int cnt = 10; double lst[cnt] = { 0.0 }; const double v[4] = { 131.313, 737.373, 979.797, 731.137 }; for(unsigned int i = 0; i ...

Python string comparison

Hello all, I have a python function that makes a subprocess call to a shell script that outputs 'true' or 'false'. I'm storing the output from subprocess.communicate() and trying to do return output == 'true' but it returns False every time. I'm not too familiar with python, but reading about string comparisons says you can compare st...

check a string if have a word

I have a string like this: "TEST.DATA.Data.COR.Point,2;TEST.DATA.Data.COR.Point,5;TEST.DATA.Data.COR.Point,12;TEST.DATA.Data.COR.Point,12;TEST.DATA.Data.COR.WordTOFIND,18" I have a list of array with that, but some dont have that wordtofind. My question is - how can I compare the string to check if have that word? ...

Does a program exist for checking two similar directories for file differences?

Is there a program to compare one folder and all subfolders to another folder and all subfolders for differences in the files contained therein (presence, absence of files, size and list of filenames)? Example of usage: I have 100 DLL files from environment 1 and I want to check if any of them are different (in size and date modified) f...

String compare in C#

I have a string like 20090101 and I want to compare it with ????01??. if (input == "----01--") { .... } How can I compare the 5th and 6th characters with "01"? ...

Python - compare nested lists and append matches to new list?

Hi, I wish to compare to nested lists of unequal length. I am interested only in a match between the first element of each sub list. Should a match exist, I wish to add the match to another list for subsequent transformation into a tab delimited file. Here is an example of what I am working with: x = [['1', 'a', 'b'], ['2', 'c', 'd']] ...

Compare and find differences in two tables in Oracle

Hi! i have 2 tables: account: ID, ACC, AE_CCY, DRCR_IND, AMOUNT, MODULE flex: ID, ACC, AE_CCY, DRCR_IND, AMOUNT, MODULE I want to show differences comparing only by: AE_CCY, DRCR_IND, AMOUNT, MODULE and ACC by first 4 characters Example: ID ACC AE_CCY DRCR_IND AMOUNT MODULE -- --------- ------ -------- ------ ------ 1 734647...

How can I compare two dates, return a number of days.

Hi, how can I compare two dates return number of days. Ex: Missing X days of the Cup. look my code. NSDateFormatter *df = [[NSDateFormatter alloc]init]; [df setDateFormat:@"d MMMM,yyyy"]; NSDate *date1 = [df dateFromString:@"11-05-2010"]; NSDate *date2 = [df dateFromString:@"11-06-2010"]; NSTimeInterval interval = [dat...

Comparing differences in an entrie workspace in TFS

As TFS maintains an idea of the version that is downloaded on the client, such that "Get Latest" might not get the latest version; I was wondering if there was an easy way to report differences across an entire workspace? I only ask as a member of my team is leaving immanently, and our IT department need to recycle his laptop very quick...

Compare images to find differences

Task: I have a camera mounted on the end of our assembly line, which captures images of produced items. Let's for example say, that we produce tickets (with some text and pictures on them). So every produced ticket is photographed and saved to disk as image. Now I would like to check these saved images for anomalies (i.e. compare them to...