Search Results

Search found 2681 results on 108 pages for 'equality operator'.

Page 20/108 | < Previous Page | 16 17 18 19 20 21 22 23 24 25 26 27  | Next Page >

  • How does the " is " operator work internally

    - by JDMX
    I want to compare the type of an object to a type to see if they are the same. I do not have the object, just the type of the object. I can do type1 == type2 and get general equality I can have a recursive loop where I repeat the above step for type1.BaseType until the BaseType is null. I can do type1.GetInterface( type2.FullName ) != null to check if type2 is an interface of type1 If I put it all together, I get if ( type2.IsInterface ) return type1.GetInterface( type2.FullName ) != null; while ( type1 != null ) { if ( type1 == type2 ) return true; type1 = type1.BaseType; } return false; Is that all the is keyword is. I cannot find the right keyword to plug into the Reflector search to find the function and a google search on "is" was not really helpful

    Read the article

  • Modulo operator in Objective-C returns the wrong result

    - by Greg Maletic
    I'm a little freaked out by the results I'm getting when I do modulo arithmetic in Objective-C. -1 % 3 is coming out to be -1, which isn't the right answer: according to my understanding, it should be 2. -2 % 3 is coming out to -2, which also isn't right: it should be 1. Is there another method I should be using besides the % operator to get the correct result?

    Read the article

  • Why can't I use interface with explicit operator?

    - by theburningmonk
    Hi, I'm just wondering if anyone knows the reason why you are not allowed to use interfaces with the implicit or explicit operators? E.g. this raises compile time error: public static explicit operator MyPlayer(IPlayer player) { ... } "user-defined conversions to or from an interface are not allowed" Thanks,

    Read the article

  • What does the operator "<<" mean in C#?

    - by Kurru
    I was doing some basic audio programming in C# using the NAudio package and I came across the following expression and I have no idea what it means, as i've never seen the << operator being used before. So what does << mean? Please give a quick explaination of this expression. short sample = (short)((buffer[index + 1] << 8) | buffer[index + 0]);

    Read the article

  • assign operator to variable in python?

    - by abhilashm86
    Usual method of applying mathematics to variables is a * b Is it able to calculate and manipulate two operands like this? a = input('enter a value') b = input('enter a value') op = raw_input('enter a operand') then how do i connect op and two variables a and b?? i know i can compare op to +, -, %, $ and then assign and compute.... but can i do something like a op b , how to tell compiler that op is an operator?? any tweaks possible?

    Read the article

  • like operator in linq

    - by Luca Romagnoli
    i need to use the like operator in a linq query for this: timb = time.Timbratures.Include("Anagrafica_Dipendente") .Where(p => p.Anagrafica_Dipendente.Cognome + " " + p.Anagrafica_Dipendente.Nome like "%ci%"); How can i do?

    Read the article

  • An interview question on conditional operator

    - by nthrgeek
    I recently encountered with this question: How to reduce this expression: s73?61:60;. The hint given was that Instead of using conditional operator we could use a simple comparison which will work fine. I am not sure but I think it is possible with some GCC extension,although I am unable to figure it out myself. EDIT:The whole expression is this : s-=s73?61:60

    Read the article

  • 'And' operator in Linq

    - by Ani
    I have a query that prints userid in label1 when username is entered.Works fine; but i want to write query for username and password that prints userid. so how can i write it? i tried writing using 'and' operator but dont seems to work. int id = (from auser in lq.logins where auser.username == userNameString //&& auser.Password =pwdString select auser.userid).SingleOrDefault(); label1.Text = id.ToString(); Thanks Ani

    Read the article

  • like operator issue

    - by Domnic
    I have dom table select * from dom dom table details: id name skills 1 dom c,c++ here i want to retrive query using like operator select * from dom where skills like '%c,c++%' then i got the desired result.....thats not a problem suppose if i want to use the belove query select * from dom where skills like '%C++,C%' i didnt get result So i have to show details even if i search reverse order in database how can i?

    Read the article

  • Calling assignment operator in copy constructor

    - by stas
    Are there some drawbacks of such implementation of copy-constructor? Foo::Foo(const Foo& i_foo) { *this = i_foo; } As I remember, it was recommend in some book to call copy constructor from assignment operator and use well-known swap trick, but I don't remember, why...

    Read the article

  • Use of infix operator hack in production code (Python)

    - by Casebash
    What is your opinion of using the infix operator hack in production code? Issues: The effect this will have on speed. The potential for a clashes with an object with these operators already defined. This seems particularly dangerous with generic code that is intended to handle objects of any type. It is a shame that this isn't built in - it really does improve readability

    Read the article

  • <:< operator in scala.

    - by scout
    Can anybody provide some details on <:< operator in scala. I think if(apple <:< fruit) //checks if apple is a subclass of fruit. Are there any other explanations? I see many definitions in the scala source file.

    Read the article

  • App Engine datastore does not support operator OR

    - by JohnIdol
    I am trying to query the google datastore for something like (with pm -- persistanceManager): String filters = "( field == 'value' || field == 'anotherValue' )"; Query query = pm.newQuery(myType.class, filters); When I execute - I am getting back: App Engine datastore does not support operator OR. What's the best approach in people experience for this kind of queries? Any help appreciated!

    Read the article

< Previous Page | 16 17 18 19 20 21 22 23 24 25 26 27  | Next Page >