comparison

C return and comparation inline

Hi everyone, I'm just to figure out what does this method do, I know there must be a way to put this line by line, can you help me please? Thanks int conditional ( int n, EXPRESSION * * o ) { return (evaluateExpression( *o++ )? evaluateExpression( *o ) : evaluateExpression( *++o ) ); } UPDATE: This is the evaluateExpression Code ...

Comparing form fields with data base fields and highlighting the form fields

Hi, Can you help me in the following two scenarios (PHP+MYSQL) Scenario1: I need to compare the HTML Form field values with the Database field values and highlight the form fields in some color whose values are different from database values before submitting the form (to alert the user). Scenario2: On loading the form, i need to co...

Detecting image equality at different resolutions

I'm trying to build a script to go through my original, high-res photos and replace the old, low-res ones I uploaded to Flickr before I had a pro account. For many of them I can just use Exif info such as date taken to determine a match. But some are really old, and either the original file didn't have Exif info, or it got clobbered by ...

Playframework and Django

I have worked with Django before and have recently seen the Play framework. Is this the Java community's answer to Django? Any experiences with it? Any performance comparisons with other Java web frameworks? Edit:Almost similar to http://stackoverflow.com/questions/1597086/any-experience-with-play-java-web-development-framework, the re...

obj-c NSArray count comparison fail

NSArray *test1 = [NSArray arrayWithObjects:@"1",@"2", nil]; NSArray *test2 = [NSArray arrayWithObjects:@"1",@"2", nil]; NSArray *test3 = [NSArray arrayWithObjects:@"1",@"2", nil]; NSLog(@"%d", [test1 count] == [test2 count] == [test3 count]); Will print 0. Why? ...

IF Statement Seems To Work Fine On Simulator, But Not On Device!

Hi Guys, Ok, the problem is that when my app runs on the simulator it seems to work fine. On the device, however it does not update all the labels. I think the error is somewhere here: - (IBAction)buttonclick1 { self.startDate = [NSDate date]; double value = [self Level]; double value2 = [self Level2]; if ((va...

How do I convert an object from Reflection to a generic collection?

I'm trying to write a Compare method to compare properties in some POCOs using Reflection to ensure that they've been persisted to the database correctly. For example, let's say I have this POCO: public class NoahsArk { public string Owner { get; set; } public ICollection<Animal> Animals { get; set; } } What I want to do is th...

Pointer equality in Haskell?

Is there any notion of pointer quality in Haskell? == requires things to be deriving Eq, and I have something which contains a (Value -> IO Value), and neither -> nor IO derive Eq. EDIT: I'm creating an interpreter for another language which does have pointer equality, so I'm trying to model this behavior while still being able to use H...

Database Feature Comparison Matrix

Does anyone know of a table or chart that compares the features of SQL Server, SQLite, and MySQL (maybe Oracle too) ? An example of what I'm looking for exists at DEVX, but doesn't include SQL Sever or SQLite ...

Logic for a file compare

I trying to write a programm for file compare. For example: file1 1 2 3 4 5 file2 1 2 @ 3 4 5 If I do it line by line, I get: 1 == 1; 2 == 2; 3 != @; 4 != 3; 5 != 4; != 5; But, the truth is that the only difference between the files is @. I want get something like this: 1 == 1; 2 == 2; != @; 3 == 3; 4 == 4; 5 == 5; Whic...

How can you easily test hash equality in Ruby when you only care about intersecting keys?

Say I have the following hashes: hash_x = { :a => 1, :b => 2 } hash_y = { :b => 2, :c => 3 } I need a chunk of logic that compares the two for equality only taking into consideration intersecting keys. In this example the 'b' key is the only commonality between the two hashes and it's value is set to '2' in both so by that ...

Why is Java's Double.compare(double, double) implemented the way it is?

I was looking at the implementation of compare(double, double) in the Java standard library (6). It reads: public static int compare(double d1, double d2) { if (d1 < d2) return -1; // Neither val is NaN, thisVal is smaller if (d1 > d2) return 1; // Neither val is NaN, thisVal is larger long thisBits =...

Using mysql_query and mysql_fetch_array

I am trying to find out which is the proper way to fetch data from my database. Either way works, but what's the difference; an in-depth explanation? $sql = mysql_query("SELECT * FROM _$setprofile"); while($row = mysql_fetch_array($sql)) { $username = $row['user']; $password = $row['pass']; echo "$username:$password"; } ve...

L2S (LINQ to SQL) or EF (Entity Framework)

I'm going to rebuilt an existing moderate-scale web-app to be used for a supply-chain-management web-solution. The core would be around some Item\Site combination-records, Organization\User management, display Organization specific data (a dashboard with 2 levels of Grid) and a Drilldown which has some complex calculations for Item trans...

Folder comparions on Command line

Hello, I want to compare two folders on Windows(Vista, XP) which have large number of huge size files, which i need to compare. If i use beyond compare or such tool to compare the folders it is taking lot and lot of time if i do it manually. I need to add that folder comparison to batch file. So, On a Windows(XP, Vista), Is there any c...

nuSoap or Zend Soap?

Hello, I would like to know the differences between nusoap and ZendSoap, which is the best? what benefits and disadvantages of each? Anyone who has used both technologies could make this comparison? Thank you ...

Loop Until Condition Reached, iPhone

Hi there, I have a problem here... After a button is pressed I want a loop to run until a condition is reached: - (IBAction)buttonclick1 ... if ((value2ForIf - valueForIf) >= 3) { ... I would like a loop to run until ((value2ForIf - valueForIf) >= 3) and then execute the code associated with the IF statement. What I am aiming t...

PHP Comparison Operators and Data Types

I'm currently working through O'Reilly's "Programming PHP" and have come across this table titled "Type of comparison performed by the comparison operators": First Operand | Second Operand | Comparison ----------------------------------------------------------------------- Number | Number ...

What is the right way to compare two filenames to see if they are the same file?

So I have two Windows filenames I need to compare to determine if they are the same. One the user gave me, one given to me by another program. So how should you compare: C:\Program Files\Application1\APP.EXE C:\Progra~1\Applic~1\APP.EXE C:\program files\applic~1\app.exe I can't seem to find a way to consistently 'normalize' the pat...

Javascript : To check if the fields in a form are not identical

Hi, I have the following problem. The following is the form i have <input type="text" name="email1" /> <input type="text" name="email2" /> <input type="text" name="email3" /> <input type="text" name="email4" /> <input type="text" name="email5" /> I want all the 5 Email ids to be different (unique) i.e, i dont want the user to be ent...