comparison

How to compare different distribution means with reference truth value in Matlab?

I have production (q) values from 4 different methods stored in the 4 matrices. Each of the 4 matrices contains q values from a different method as: Matrix_1 = 1 row x 20 column Matrix_2 = 100 rows x 20 columns Matrix_3 = 100 rows x 20 columns Matrix_4 = 100 rows x 20 columns The number of columns indicate the number of years. ...

A bad result of the comparison - PHP

Hi, I have a function that connects to the database and returns a number and a second function, which returns the size of a file. If I use the echo function to view the results functions: variable1 = 1345064, and variable2 = 135 ,but when I use a comparison, go me incorrect result: if($variable1 < $variable2) { echo 'This code is ...

Should you use 'isEqual' or '==' ?

Hey. I saw a couple of questions here on SO, with ansers including the function isEqual: instead of the standard ==. So far, I have only learned to use the ==, so I'm wondering what's better to use, what are the pros and cons of each? When should you use them? Thank you. ...

Mathematical library to compare simularities in graphs of data for a high level language (eg. Javascript)?

I'm looking for something that I guess is rather sophisticated and might not exist publicly, but hopefully it does. I basically have a database with lots of items which all have values (y) that correspond to other values (x). Eg. one of these items might look like: x | 1 | 2 | 3 | 4 | 5 y | 12 | 14 | 16 | 8 | 6 This is just a a rando...

Comparing two sets for new and missing keys

When comparing two key-value dictionary sets in C#: set A and set B, what is the best way to enumerate keys present in set A but missing from set B and vice-versa? For example: A = { 1, 2, 5 } B = { 2, 3, 5 } Comparing B with A, missing keys = { 1 } and new keys = { 3 }. Using Dictionary<...,...> objects, one can enumerating all val...

Comparing to NSDates not working, incompatible pointer types

Hey i am trying to compare the date on which the user opens the app to the date it is currently. (basically, how long they've had the app in days) Here is the code: - (NSInteger) daysAfterDate: (NSDate *) aDate { NSTimeInterval ti = [self timeIntervalSinceDate:aDate]; //#1 return (NSInteger) (ti / D_DAY); //#2 } //#3 -(void)l...

'Regular Expression' VS 'String Comparison operators / functions'

Hello. This question is designed around the performance within PHP but you may broaden it to any language if you wish to. After many years of using PHP and having to compare strings I've learned that using string comparison operators over regular expressions is beneficial when it comes to performance. I fully understand that some oper...

How do I compare 2 tables looking for missing items.

I have two tables one that contains a huge list of items and another that trading for those items. Here are examples tables: The main table | ID | TITLE | STATUS | TRADE | ------------------------------- | 1 | test1 | 1 | 1 | | 2 | test2 | 1 | 1 | | 3 | test3 | 1 | 0 | | 4 | test4 | 0 | 1 | Th...

PosqtgreSQL string comparison

I try to compare strings in PostgreSQL. Here are queries that I execute: select 'UK (z'>'Ukraine'; This one returns true; Then I try following one: select 'UK ('>'Ukraine'; This one returns false; I think, that both of these should return false , and on another PostgreSQL server it behaves correctly. But main server is producing...

null terminator gives trouble with string length when comparing

I'm trying to compare 2 strings by "==" operator. when i print the string both are identical. but length of one is bigger by one, i figured it is the null terminator. any way to ignore this when comparing?? Thanks!! City* Adjutancy::FromStringToCity(string cityName) const { for (list<City*>::const_iterator it=m_citiesList.begin();it...

String comparison in dotnet framework 4

Hi all, I explain my problem and interrogation (excuse my bad english), i have a dotnet exe which every milliseconds past to processing is very important. This program do lot's of string comparison (most of it is "string1.IndexOf(string2, StringComparison.OrdinalIgnoreCase")) When i switch in framework 4 my program time is twice than...

Stored Procedures Vs. Views

Hi, I have used both but what I am not clear is when I should prefer one over the other. I mean I know stored procedure can take in parameters...but really we can still perform the same thing using Views too right ? So considering performance and other aspects when and why should I prefer one over the other ? ...

Comparing time in NSDate

I am trying to compare the time from two NSDate objects but am getting the wrong answer. I think it is because when using the NSDate compare methods it is also including the date. I just want to ignore the date and compare the times. How can this be done? ...

Comparing text blocks for similar content

I have two text blocks, containing company names. Both contain names of hundreds of companies, the newer list has more companies. How do I remove the duplicate company names from the two lists , so that I am left with the new names only? Sample text block one: Company Name One, Address line 1, line 2, phone, email .. Random text .. Co...

Abstract: Should I choose ASP.Net MVC over Web Forms or ..

I've been working with web for over 7 yrs and I've upgraded from html->ASP->ASP.Net and now the new flavors of ASP.Net itself. I was to begin with MVC last year but due to deadline and the complexity involved in MVC I couldn't. Now, once again there's a new upgrade - I've begun with the ASP.Net DD (Dynamic Data) Templates (the latest one...

Detecting Similar images

Possible Duplicate: Image comparison algorithm So basically i need to write a program that checks whether 2 images are the same or not. Consider the following 2 images: http://i221.photobucket.com/albums/dd298/ramdeen32/starry_night.jpg http://i221.photobucket.com/albums/dd298/ramdeen32/starry_night2.jpg Well they are both ...

NULL comparison, take 2

Hello all, I have a subquery, used in WHERE section: A.column <> B.column Unfortunately, it doesn't work, if either A.column or B.column is NULL. So, I converted it to: ((A.column <> B.column) OR ((A.column IS NULL) <> (B.column IS NULL))) , presuming that "Table.column IS NULL" is boolean value and I can compare 2 boolean values....

Python comparison functions

I have some data that lends itself to representation as a value and a comparison function, (val, f), so another value can be checked against it by seeing if f(val, another) is True. That's easy. Some of them just need >, <, or == as f, however, and I can't find a clean way of using them; I end up writing things like ScorePoint(60, la...

Floating point comparison - Result between different runs

I know that I can not compare two floating point or double numbers for absolute equality on C++/C. If for some reason, I write a if condition which uses the absolute equality, is it guaranteed that the if condition will return the same result on different runs of the program for same data? Or it is purely non-deterministic and the result...

Any recent performance comparison among Javascript, Silverlight and Flash

This is really a duplicate of the question- link text I googled it and found some old results like bubblemark.com, link text and link text. But is there any recent benchmarks as all the platforms have been updated. I like to measure the speed of silverlight 4 against the modern and faster javascript engines. Anyone have any source? ...