comparison

What web-development platform should I use considering Time-To-Market?

I have been looking at a few differend platforms for my coming web-development project. I would like to hear what web-development platform is recommended when considering Time-To-Maket. Suppose that I already know the programming language well, but not the web-framework. The OS will be Linux. My requirements and priorities: Time-To-Ma...

Java Integer: what is faster comparison or subtraction?

I've found that java.lang.Integer implementation of compareTo method looks as follows: public int compareTo(Integer anotherInteger) { int thisVal = this.value; int anotherVal = anotherInteger.value; return (thisVal<anotherVal ? -1 : (thisVal==anotherVal ? 0 : 1)); } The question is why use comparison instead of subtraction: return th...

Finding a smaller value and swap values in php

Hi $var1 = 22; $var2 = 10; echo $var1 = ($var1 < $var2) ? $var1 : $var2; //smaller var echo '<br />'; echo $var2 = ($var1 > $var2) ? $var1 : $var2; //greater var I expect it to print 10 and 22 but it prints 10 and 10. any ideas what I am doing wrong? Thanks UPDATE Thanks all. $min = min($var1, $var2); $...

kill unsigned / signed comparison error

In general, I want warnings of unsigned vs signed. However, in this particular case, I want it suppressed; std::vector<Blah> blahs; for(int i = 0; i < blahs.size(); ++i) { ... I want to kill this comparison. Thanks! (using g++) ...

Disadvantage of Python eggs?

Are there any disadvantages about using eggs through easy-install compared to the "traditional" packages/modules/libs? ...

How to sort an array or ArrayList<Point> ASC first by x and then by y?

Hi everyone, I just want to use Collections.sort or Arrays.sort to sort a list of points (class Point) by x first and then by y. I have a class Ponto that implements Comparable like this: public int compareTo(Ponto obj) { Ponto tmp = obj; if (this.x < tmp.x) { return -1; } else if (this.x > tmp.x) {...

Dates comparisons in java

hello, I would like to compare a date to the current date. could you please tell me how to do that in java. ...

Is this possible somehow in C# : if (a==b==c==d) {...}

Hi, Is there a quick way to compare equality of more than one values in C#? something like: if (5==6==2==2){ //do something } Thanks ...

Which is better H2 or HSQLDB?

HSQLDB 2.0 is soon to be released. I wonder if it will outperform H2 since, as far as I know, most users prefer H2 than HSQLDB. I am interested in the MVCC support of HSQLDB 2.0. I have learned that MVCC on H2 is still experimental. With regards to support/documentation, concurrency, performance, which is better between the two? ...

Color Comparison of two images using matlab

Is it possible to compare the color of two images using Matlab if the two images are of different sizes?The problem that am facing is that, i want to detect the presence of a colored patch in an image? ...

PHP Frameworks: Do any of them compare to Visual Studio?

Are there any coders out there that have real experience/exposure to both PHP and ASP.net? I'm a C# developer, wondering if any PHP frameworks compare to the robustness of the Visual Studio Development environment. ...

Delphi Math: Why is 0.7<0.70?

If I have variables a, b, an c of type double, let c:=a/b, and give a and b values of 7 and 10, then c's value of 0.7 registers as being LESS THAN 0.70. On the other hand, if the variables are all type extended, then c's value of 0.7 does not register as being less than 0.70. This seems strange. What information am I missing? ...

Who can tell me about his own experience using Magnolia CMS?

I am looking for some comments on Magnolia CMS. Is there anybody out there having experience on Magnolia and willing to tell about? I am interested in comments like usability, how fast to start with, potential problems, advantages, disadvantages (in comparison to other open source CMS). E.g. I could not find out if Magnolia is able to us...

MySQL compare DATE string with string from DATETIME field.

Hello. I have a question: Is it possible to select form MySQL database by comparing one DATE string "2010-04-29" against strings that are stored as DATETIME (2010-04-29 10:00) ? I have one date picker that filters data and I would like to query the table by the DATETIME field like this: SELECT * FROM `calendar` WHERE startTime = '2010-...

Anything wrong with this function for comparing floats?

When my Floating-Point Guide was yesterday published on slashdot, I got a lot of flak for my suggested comparison function, which was indeed inadequate. So I finally did the sensible thing and wrote a test suite to see whether I could get them all to pass. Here is my result so far. And I wonder if this is really as good as one can get wi...

Java Compare Two Lists

I have two lists ( not java lists, you can say two columns) For example **List 1** **Lists 2** milan hafil dingo iga iga dingo elpha binga hafil mike meat dingo milan elpha meat iga neet...

How do I compare two complex data structures?

I have some nested datastructures, each something like: [ ('foo', [ {'a':1, 'b':2}, {'a':3.3, 'b':7} ]), ('bar', [ {'a':4, 'd':'efg', 'e':False} ]) ] I need to compare these structures, to see if there are any differences. Short of writing a function to explicitly walk the structure, is there an existing library o...

In C, would !~b ever be faster than b == 0xff ?

From a long time ago I have a memory which has stuck with me that says comparisons against zero are faster than any other value (ahem Z80). In some C code I'm writing I want to skip values which have all their bits set. Currently the type of these values is char but may change. I have two different alternatives to perform the test: if ...

Charts or Stats comparing Database vs. HTTP vs. Direct File Access Performance?

I am wondering what the stats are for different ways of storing (and therefore retrieving) content. Are there any charts out there, or do you guys have any quick tests to show, the requests per second, etc., of: Direct (local) database access, vs. HTTP Access to cached data, vs. HTTP Access to uncached data (remote database), vs. Dire...

Numeric comparison difficulty in R

I'm trying to compare two numbers in R as a part of a if-statement condition: (a-b) >= 0.5 In this particular instance, a = 0.58 and b = 0.08... and yet (a-b) >= 0.5 is false. I'm aware of the dangers of using == for exact number comparisons, and this seems related: (a - b) == 0.5) is false, while all.equal((a - b), 0.5) is true. ...