Search Results

Search found 2896 results on 116 pages for 'comparison operators'.

Page 4/116 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Shift Operators in C++

    - by Codeguru
    If the value after the shift operator is greater than the number of bits in the left-hand operand, the result is undefined. If the left-hand operand is unsigned, the right shift is a logical shift so the upper bits will be filled with zeros. If the left-hand operand is signed, the right shift may or may not be a logical shift (that is, the behavior is undefined). Can somebody explain me what the above lines mean??

    Read the article

  • Basic C++ Speed (initialization vs adding) and comparison speed

    - by seld
    I was curious if anyone knows which of the following executes faster (I know this seems like a weird question but I'm trying to shave as much time and resources as possible off my program.) int i; i+=1; or int i; i=1; and I also was curious about which comparison is faster: //given some integer i // X is some constant i < X+1 or i<=X

    Read the article

  • Java Integer: what is faster comparison or subtraction?

    - by Vladimir
    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 thisVal - anotherVal;

    Read the article

  • DB comparison tools

    - by Dimi Toulakis
    Has someone experience with database comparison tools? Which one you would recommend? We are currently using "SQLCompare" from Redgate, but I am curious to know if there are better tools on the market. The main requirement is that they should be able to compare scripts folder against a live database. Thanks, Dimi

    Read the article

  • Any good SQL Anywhere database schema comparison tools?

    - by Lurker Indeed
    Are there any good database schema comparison tools out there that support Sybase SQL Anywhere version 10? I've seen a litany of them for SQL Server, a few for MySQL and Oracle, but nothing that supports SQL Anywhere correctly. I tried using DB Solo, but it turned all my non-unique indexes into unique ones, and I didn't see any options to change that.

    Read the article

  • SQL Comparison Tools

    - by David Ward
    Which SQL comparison tool would you recommend for SQL server database comparisons. I've been looking at SQL Compare and SQL Delta. I'd like the ability to compare and sync database schema and data.

    Read the article

  • Java Interger: what is faster comparison or subtraction?

    - by Vladimir
    I've found that java.lang.Ingteger 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 thisVal - anotherVal;

    Read the article

  • facial comparison software

    - by chris beardmore
    I have images of my children we all do, but I have found a picture of a toddler that bears great resemblance to 1 of my own sons on the internet, is there any software available that I can perform side-by-side comparison with, or maybe software that can give an X-% probability match

    Read the article

  • What does "===" mean?

    - by Stefan Konno
    I recently studied some code that I'm supposed to use for different reasons, it's unrelevant. The thing I've noticed is someone using the operator "===" which I can't make sense out of. I've tried it with a function and it corresponds in crazy ways. The language is PHP by the way. Does anyone know what the definition of this operator is, I can't even find it in the declaration of php operators.

    Read the article

  • Integer comparison as string

    - by J Pollack
    Hi I have an integer column and I want to find numbers that start with specific digits. For example they do match if I look for '123': 1234567 123456 1234 They do not match: 23456 112345 0123445 Is the only way to handle the task by converting the Integers into Strings before doing string comparison? Also I am using Postgre regexp_replace(text, pattern, replacement) on numbers which is very slow and inefficient way doing it. The case is that I have large amount of data to handle this way and I am looking for the most economical way doing this.

    Read the article

  • MySQL DATETIME format comparison - is strtotime needed?

    - by Steffan
    I've been doing something along the lines of.. $dt1 = '1000-01-01 00:00:00'; //really some val from db $dt2 = '1000-01-01 00:00:10'; //another val maybe db maybe formatted if(strtotime($dt1) > strtotime($dt2){ //do something } Is the strtotime needed? can i do a more direct comparison on the datetime formatted strings? i.e. if($dt1 > $dt2){ //do something } Will that always work?

    Read the article

  • Floating point comparison in STL, BOOST

    - by Paul
    Is there in the STL or in Boost a set of generic simple comparison functions? The one I found are always requiring template parameters, and/or instantiation of a struct template. I'm looking for something with a syntax like : if ( is_greater(x,y) ) { ... } Which could be implemented as : template <typename T> bool is_greater(const T& x, const T& y) { return x > y + Precision<T>::eps; }

    Read the article

  • comparison between string literal

    - by wiso
    This very simple code: #include <iostream> using namespace std; void exec(char* option) { cout << "option is " << option << endl; if (option == "foo") cout << "option foo"; else if (option == "bar") cout << "opzion bar"; else cout << "???"; cout << endl; } int main() { char opt[] = "foo"; exec(opt); return 0; } generate two warning: comparison with string literal results in unspecified behaviour. Can you explain why exactly this code doesn't work, but if I change char opt[] to char *opt it works, but generates the warning? Is it related to the \0 termination? What is the difference between the two declaration of opt? What if I use const qualifier? The solution is to use std::string?

    Read the article

  • html5 vs flash - full comparison chart anywhere?

    - by iddqd
    So since Steve Jobs said Flash sucks and implied that HTML5 can do everything Flash can without the need for a Plugin, I keep hearing those exact words from a lot of People. I would really like to have a Chart somewhere (similar to http://en.wikipedia.org/wiki/Comparison_of_layout_engines_%28HTML5%29#Form_elements_and_attributes ) that I can just show to those people. Showing all the little things that Flash can do right now, that HTML5/Ajax/CSS is not yet even thinking about. But of course also the things that HTML5 does better. I would like to see details compared like audio playback, realtime audio processing, byte level access, bitmap data manipulation, webcam access, binary sockets, stuff in the works such as P2P technology (adobe stratus) and all the stuff I don't know about myself. Ideally with examples of what can be accomplished with, lets say Binary Sockets (such as a POP3 client) because otherwise it won't mean a lot to non-programmers since they will just say "well we can do without Binary Sockets". And ideally with some current benchmarks and some examples of websites that use this technology. I've searched the web and am surprised not to find anything. So is there such a comparison somewhere? Or does anybody want to create this and post it to Wikipedia? ;-)

    Read the article

  • Log 2 N generic comparison tree

    - by Morano88
    Hey! I'm working on an algorithm for Redundant Binary Representation (RBR) where every two bits represent a digit. I designed the comparator that takes 4 bits and gives out 2 bits. I want to make the comparison in log 2 n so If I have X and Y .. I compare every 2 bits of X with every 2 bits of Y. This is smooth if the number of bits of X or Y equals n where (n = 2^X) i.e n = 2,4,8,16,32,... etc. Like this : However, If my input let us say is 6 or 10 .. then it becomes not smooth and I have to take into account some odd situations like this : I have a shallow experience in algorithms .. is there a generic way to do it .. so at the end I get only 2 bits no matter what the input is ? I just need hints or pseudo-code. If my question is not appropriate here .. so feel free to flag it or tell me to remove it. I'm using VHDL by the way!

    Read the article

  • Declaring functors for comparison ??

    - by Mr.Gando
    Hello, I have seen other people questions but found none that applied to what I'm trying to achieve here. I'm trying to sort Entities via my EntityManager class using std::sort and a std::vector<Entity *> /*Entity.h*/ class Entity { public: float x,y; }; struct compareByX{ bool operator()(const GameEntity &a, const GameEntity &b) { return (a.x < b.x); } }; /*Class EntityManager that uses Entitiy*/ typedef std::vector<Entity *> ENTITY_VECTOR; //Entity reference vector class EntityManager: public Entity { private: ENTITY_VECTOR managedEntities; public: void sortEntitiesX(); }; void EntityManager::sortEntitiesX() { /*perform sorting of the entitiesList by their X value*/ compareByX comparer; std::sort(entityList.begin(), entityList.end(), comparer); } I'm getting a dozen of errors like : error: no match for call to '(compareByX) (GameEntity* const&, GameEntity* const&)' : note: candidates are: bool compareByX::operator()(const GameEntity&, const GameEntity&) I'm not sure but ENTITY_VECTOR is std::vector<Entity *> , and I don't know if that could be the problem when using the compareByX functor ? I'm pretty new to C++, so any kind of help is welcome.

    Read the article

  • Ambiguous Comparison Hint

    - by Ondrej Brejla
    Hi everybody! Today we would like to show you some new hint which will be available in NetBeans 7.3. It's called Ambiguous Comparison hint. Its name seems to be quite fuzzy, but it describes exactly what the hint does. It tries to check all comparisons whether they are intended. Because sometimes you want to make a simple assignment, but you make a typo and comparison appears. It's really dangerous mistake because then your code doesn't work as expected. Your application can produce buggy results. So here is how it looks like: But sometimes a comparison is really intended. E.g. in return statements when you want to return a boolean, so then the hint works as expected and no warning appears. That's all for today and as usual, please test it and if you find something strange, don't hesitate to file a new issue (component php, subcomponent Editor). Thanks.

    Read the article

  • Conversion constructor vs. conversion operator: precedence

    - by GRB
    Reading some questions here on SO about conversion operators and constructors got me thinking about the interaction between them, namely when there is an 'ambiguous' call. Consider the following code: class A; class B { public: B(){} B(const A&) //conversion constructor { cout << "called B's conversion constructor" << endl; } }; class A { public: operator B() //conversion operator { cout << "called A's conversion operator" << endl; return B(); } }; int main() { B b = A(); //what should be called here? apparently, A::operator B() return 0; } The above code displays "called A's conversion operator", meaning that the conversion operator is called as opposed to the constructor. If you remove/comment out the operator B() code from A, the compiler will happily switch over to using the constructor instead (with no other changes to the code). My questions are: Since the compiler doesn't consider B b = A(); to be an ambiguous call, there must be some type of precedence at work here. Where exactly is this precedence established? (a reference/quote from the C++ standard would be appreciated) From an object-oriented philosophical standpoint, is this the way the code should behave? Who knows more about how an A object should become a B object, A or B? According to C++, the answer is A -- is there anything in object-oriented practice that suggests this should be the case? To me personally, it would make sense either way, so I'm interested to know how the choice was made. Thanks in advance

    Read the article

  • Comparison of Hudson, CDash, CruisonControl, TeamCity for Continuous Integration / Builder

    - by Wernight
    I found most people talk about Hudson for simple and free continuous integration. Now personally I'm not fond of its interface which I find very messy, and I found almost no one talking about CDash -- I love CMake and CTest seem nice too. Could you give for each continuous integration server/builder/tester/dashboard a short description of its strong and weak decision points. Here is a list of those I've heard of, or used: Hudson CDash CruisonControl TeamCity Bamboo Environment: C++, C#, Python, PHP... can be various. PS: Preferably give one answer per tool or comment on it there is already one.

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >