Search Results

Search found 4206 results on 169 pages for 'equals operator'.

Page 8/169 | < Previous Page | 4 5 6 7 8 9 10 11 12 13 14 15  | Next Page >

  • Working with Reporting Services Filters – Part 2: The LIKE Operator

    - by smisner
    In the first post of this series, I introduced the use of filters within the report rather than in the query. I included a list of filter operators, and then focused on the use of the IN operator. As I mentioned in the previous post, the use of some of these operators is not obvious, so I'm going to spend some time explaining them as well as describing ways that you can use report filters in Reporting Services in this series of blog posts. Now let's look at the LIKE operator. If you write T-SQL queries, you've undoubtedly used the LIKE operator to produce a query using the % symbol as a wildcard for multiple characters like this: select * from DimProduct where EnglishProductName like '%Silver%' And you know that you can use the _ symbol as a wildcard for a single character like this: select * from DimProduct where EnglishProductName like '_L Mountain Frame - Black, 4_'   So when you encounter the LIKE operator in a Reporting Services filter, you probably expect it to work the same way. But it doesn't. You use the * symbol as a wildcard for multiple characters as shown here: Expression Data Type Operator Value [EnglishProductName] Text Like *Silver* Note that you don’t have to include quotes around the string that you use for comparison. Books Online has an example of using the % symbol as a wildcard for a single character, but I have not been able to successfully use this wildcard. If anyone has a working example, I’d love to see it!

    Read the article

  • Which to use - "operator new" or "operator new[]" - to allocate a block of raw memory in C++?

    - by sharptooth
    My C++ program needs a block of uninitialized memory. In C I would use malloc() and later free(). In C++ I can either call ::operator new or ::operator new[] and ::operator delete or operator delete[] respectively later. Looks like both ::operator new and ::operator new[] have exactly the same signature and exactly the same behavior. The same for ::operator delete and ::operator delete[]. The only thing I shouldn't do is pairing operator new with operator delete[] and vice versa - undefined behavior. Other than that which pair do I choose and why?

    Read the article

  • Java: If I overwrite the .equals method, can I still test for reference equality with ==?

    - by shots fired
    I have the following situation: I need to sort trees based by height, so I made the Tree's comparable using the height attribute. However, I was also told to overwrite the equals and hashCode methods to avoid unpredictable behaviour. Still, sometimes I may want to compare the references of the roots or something along those lines using ==. Is that still possible or does the == comparison call the equals method?

    Read the article

  • C++ operator new, object versions, and the allocation sizes

    - by mizubasho
    Hi. I have a question about different versions of an object, their sizes, and allocation. The platform is Solaris 8 (and higher). Let's say we have programs A, B, and C that all link to a shared library D. Some class is defined in the library D, let's call it 'classD', and assume the size is 100 bytes. Now, we want to add a few members to classD for the next version of program A, without affecting existing binaries B or C. The new size will be, say, 120 bytes. We want program A to use the new definition of classD (120 bytes), while programs B and C continue to use the old definition of classD (100 bytes). A, B, and C all use the operator "new" to create instances of D. The question is, when does the operator "new" know the amount of memory to allocate? Compile time or run time? One thing I am afraid of is, programs B and C expect classD to be and alloate 100 bytes whereas the new shared library D requires 120 bytes for classD, and this inconsistency may cause memory corruption in programs B and C if I link them with the new library D. In other words, the area for extra 20 bytes that the new classD require may be allocated to some other variables by program B and C. Is this assumption correct? Thanks for your help.

    Read the article

  • Reflection and Operator Overloads in C#

    - by TenshiNoK
    Here's the deal. I've got a program that will load a given assembly, parse through all Types and their Members and compile a TreeView (very similar to old MSDN site) and then build HTML pages for each node in the TreeView. It basically takes a given assembly and allows the user to create their own MSDN-like library for it for documentation purposes. Here's the problem I've run into: whenever an operator overload is encounted in a defined class, reflection returns that as a "MethodInfo" with the name set to something like "op_Assign" or "op_Equality". I want to be able to capture these and list them properly, but I can't find anything in the MethodInfo object that is returned to accurately identify that I'm looking at an operator. I definitely don't want to just capture everything that starts with "op_", since that will most certainly (at some point) will pick up a method it's not supposed to. I know that other methods and properties that are "special cases" like this one have the "IsSpecialName" property set, but appearantly that's not the case with operators. I've been scouring the 'net and wracking my brain to two days trying to figure this one out, so any help will be greatly appreciated.

    Read the article

  • PHP ternary operator

    - by thecoshman
    ($DAO->get_num_rows() == 1) ? echo("is") : echo("are"); This dose not seem to be working for me,I get an error "Unexpected T_ECHO" I have tried it with out the brackets around the conditional. Am I just not able to use a ternary operator in this way? The $DAO-get_num_rows() returns an integer value. Thanks

    Read the article

  • C# Nested Property Accessing overloading OR Sequential Operator Overloading

    - by Tim
    Hey, I've been searching around for a solution to a tricky problem we're having with our code base. To start, our code resembles the following: class User { int id; int accountId; Account account { get { return Account.Get(accountId); } } } class Account { int accountId; OnlinePresence Presence { get { return OnlinePresence.Get(accountId); } } public static Account Get(int accountId) { // hits a database and gets back our object. } } class OnlinePresence { int accountId; bool isOnline; public static OnlinePresence Get(int accountId) { // hits a database and gets back our object. } } What we're often doing in our code is trying to access the account Presence of a user by doing var presence = user.Account.Presence; The problem with this is that this is actually making two requests to the database. One to get the Account object, and then one to get the Presence object. We could easily knock this down to one request if we did the following : var presence = UserPresence.Get(user.id); This works, but sort of requires developers to have an understanding of the UserPresence class/methods that would be nice to eliminate. I've thought of a couple of cool ways to be able to handle this problem, and was wondering if anyone knows if these are possible, if there are other ways of handling this, or if we just need to think more as we're coding and do the UserPresence.Get instead of using properties. Overload nested accessors. It would be cool if inside the User class I could write some sort of "extension" that would say "any time a User object's Account property's Presence object is being accessed, do this instead". Overload the . operator with knowledge of what comes after. If I could somehow overload the . operator only in situations where the object on the right is also being "dotted" it would be great. Both of these seem like things that could be handled at compile time, but perhaps I'm missing something (would reflection make this difficult?). Am I looking at things completely incorrectly? Is there a way of enforcing this that removes the burden from the user of the business logic? Thanks! Tim

    Read the article

  • Java operator precedence guidelines

    - by trashgod
    Misunderstanding Java operator precedence is a source of frequently asked questions and subtle errors. I was intrigued to learn that even the Java Language Specification says, "It is recommended that code not rely crucially on this specification." JLS §15.7 Preferring clear to clever, are there any useful guidelines in this area? Here are a number of resources on the topic: JLS Operators JLS Precedence Java Glossary Princeton Sun Tutorial University of West Florida Usenet discussion Additions or corrections welcome.

    Read the article

  • redefine __and__ operator

    - by wiso
    Why I can't redefine the __and__ operator? class Cut(object): def __init__(self, cut): self.cut = cut def __and__(self, other): return Cut("(" + self.cut + ") && (" + other.cut + ")") a = Cut("a>0") b = cut("b>0") c = a and b print c.cut() I want (a>0) && (b>0), but I got b, that the usual behaviour of and

    Read the article

  • Regex AND operator

    - by user366735
    Based on this answer http://stackoverflow.com/questions/469913/regular-expressions-is-there-an-and-operator I tried the following on http://regexpal.com/ but was unable to get it to work. What am missing? Does javascript not support it? Regex: (?=foo)(?=baz) String: foo,bar,baz

    Read the article

  • subscript operator on pointers

    - by Lodle
    If i have a pointer to an object that has an overloaded subscript operator ( [] ) why cant i do this: MyClass *a = new MyClass(); a[1]; but have to do this instead: MyClass *a = new MyClass(); (*a)[1];

    Read the article

  • Using operator+ without leaking memory?

    - by xokmzxoo
    So the code in question is this: const String String::operator+ (const String& rhs) { String tmp; tmp.Set(this->mString); tmp.Append(rhs.mString); return tmp; } This of course places the String on the stack and it gets removed and returns garbage. And placing it on the heap would leak memory. So how should I do this?

    Read the article

  • Operator precedence in scala

    - by Jeriho
    I like scala's propose of operator precedence but in some rare case unmodified rules may be inconvenient because you have restrictions in naming your methods. Is there in scala ways to define another rules for a class/file/etc? If not would it be resolved in future?

    Read the article

  • how to call operator () in c++

    - by anish
    in c++ i have following code class Foobar{ public: Foobar * operator()(){ return new Foobar; } My quesion is how to call the (); if i do Foobar foo() the constructor gets called i am confused about behaviour of () can some explain me

    Read the article

  • typedef and operator overloading in C

    - by jocapco
    Suppose I typedef an integer or integer array or any known type: typedef int int2 Then I overload operator * for int2 pairs, now if I initialize variables a and b as int. Then will my * between a and b be the overloaded * ? How do I achieve overloading an int and yet also use * for int the way they are. Should I create a new type?

    Read the article

  • Where namespace does operator<< (stream) go to?

    - by aaa
    If I have have some overloaded ostream operators, defined for library local objects, is its okay for them to go to std namespace? If I do not declare them in std namespace, then I must use using ns:: operator <<. As a possible follow-up question, are there any operators which should go to standard or global namespace?

    Read the article

< Previous Page | 4 5 6 7 8 9 10 11 12 13 14 15  | Next Page >