compare

how to find out is a long string contatins a word obj c, iphone

I have a long string that has a running list of all the "words entered" in the text box. I want to be able to check the long string against a one word string to see if the long string contains the word in the short string. Any ideas? I've tried this and a few other things, where newString is the long string and currentTextrightnow is ...

how to achieve online txt content compare

i want integrate a wediget about text compare to my web project,is there some easy to achieve this function,or some open source project easy to use? ...

wpf overriding getHashCode and Eqaul in ContentControl

Hi I have a class which derives from ContentControl and I'm not able to override GetHashCode and Equal method. I get an error Error 5 cannot override inherited member 'System.Windows.DependencyObject.GetHashCode()' because it is sealed Is there any way to override this method ? I need to use Union method from LINQ however I need to c...

file tree extended comparison

There has been a similar question concerning comparison of file trees, but it was suggested to start a new question. I think to write a file tree comparison tool for huge directory trees including extended attributes. The available tools like find, diff, xattr seem to be not optimum for that. I want to compare huge file trees incremen...

comparing two objects by two properties

How to sort two objects in a list by using two properties one by ascending and the other by descending order. when linq is used it says i need to implement IComparer interface but not sure how to compare two objects by using two properties at once. Say Person class by Name ascending and Age descending. ...

Compare fields of two unrelated objects

Hi. I've got two objects of different classes that share some fields with the same name and type. These two objects are not related to each other. There's no possibility for me to create an interface or a parent class. Now I want to compare those shared fields and as far as I know this should be possible using reflection. These are th...

How to compare two .PGM images in Java?

Hi, i need to compare 2 .pgm images in java. I use this to display the image: PlanarImage pgmImage = JAI.create("fileload", "test.pgm"); ImageIcon icon = new ImageIcon(pgmImage.getAsBufferedImage()); The comparing type is: Image A, px 1 = 220; Image A, px2 =....; Image A pxN=...; Image B, px 1 = 180; Image B, px2=....; Image A pxN...

Find oldest/youngest datetime object in a list

I've got a list of datetime objects, and I want to find the oldest or youngest one. Some of these dates might be in the future. from datetime import datetime datetime_list = [ datetime(2009, 10, 12, 10, 10), datetime(2010, 10, 12, 10, 10), datetime(2010, 10, 12, 10, 10), datetime(2011, 10, 12, 10, 10), #future datet...

Emacs technique for comparing sections of documents?

I'd like to be able to open two windows in Emacs, select a region of text in each window, and get a comparison of the difference between the two selections. This would be very handy for a large-scale maintenance project, where I'm working on a version tree with multiple branches, lots of copy/paste, and code that is being moved around ...

XMLUnit - Compare two XML ignoring the child order

Hello, I am trying to see if I could use XMLUnit to compare the following two different XML. I used the Diff class to compare the following two XML and checking for similar returns false. XML One <Required> <Question desc="Are you single?"> <Answers> <Answer value="Yes"/> <Answer value="No"/> </Answers> ...

Comparing objects in ruby

Consider this: class Aaa attr_accessor :a, :b end x = Aaa.new x.a, x.b = 1,2 y = Aaa.new y.a, y.b = 1,2 puts x == y #=>false Is there some way to check if all public attributes are equal in classes of same type? ...

How to compare two datetimes

I wonder how to compare two DateTime objects in .NET using DateTime methods Compare, CompareTo or Equals without comparing ticks. I only need a tolerance level of milliseconds or seconds. How can this be done? ...

Compare a NSNumber to an int

Hi! I've a simple question (I think): I'm trying to compare a NSNumber with a int, to see if it is 0 or 1. Here is the code: id i = [dictionary objectForKey:@"error"]; //class = NSCFNumber NSLog(@"%@ == 0 -> %@", i, i == 0); NSLog(@"%@ == 0 -> %@", i, [i compare:[NSNumber numberWithBool:NO]]); I tried this to methods but I get null a...

C++ tstring compare

hello again I have this variable dirpath2 where I store the deepest directory name of a path: typedef std::basic_string<TCHAR> tstring; tstring dirPath = destPath; tstring dirpath2 = dirPath.substr(destPathLenght - 7,destPathLenght - 1); I want to be able to compare it it another string, something like: if ( _tcscmp(dirpath2,failed)...

How would a write a LINQ query to compare with a list of values ?

I have basically to select all employee from companies which are being passed so a variable - CompanyListIds - Contains list of all company ids.. var result=DataContext.Employee(e=>e.CompanyId==companyId).ToList(); The above is a query I have for selecting from one company, now how would I modify it to compare with all the companyi...

I'm having problems using dates in Android

I am trying to compare dates and I have found where my code goes wrong, but I don't know why. I am trying to compare a date with todays date (using Gregorian Calendars only). I have printed out todays date where ever it is mentioned in the code and in one place it magically changes from year 2010 to year 3910 (todays year + 1900). Doe...

Compare RGB colors in c#

Hello, I'm trying to find a way to compare two colors to find out how much they are alike. I can't seem to find any resources about the subject so I'm hoping to get some pointers here. Idealy, I would like to get a score that tells how much they are alike. For example, 0 to 100, where 100 would be equal and 0 would be totally different...

How do I compare Silverlight StylusPoints to a Path?

Can someone point me in the right direction on how I would compare a Stroke StylePoints collection to a Path? I basically want to compare the users traced manipulation over a shape to see how accurate they were. I'd also like to add a threshold for error. Thank you! Tim ...

Is it possible to compare more than two kernels executions at a time in Compute Prof (OpenCL/CUDA)

Is it possible to compare more than two kernels executions at a time in Compute Prof? ...

Can I pass arguments to the compare subroutine of sort in Perl?

I'm using sort with a customized comparison subroutine I've written: sub special_compare { # calc something using $a and $b # return value } my @sorted = sort special_compare @list; I know it's best use $a and $b which are automatically set, but sometimes I'd like my special_compare to get more arguments, i.e.: sub special_compare...