operators

Java =+ operator

Possible Duplicate: What is the difference between += and =+? I know what saying x+=1; means but what does saying x=+1; mean? ...

weird compiler error when casting in ternary/conditional operator

I'm experiencing unexpected compiler errors with this code: bool b = true; //or false StringBuilder builder = ...; // a string builder filled with content IVersePart vp = b ? (DualLanguageVersePart)builder : (VersePart)builder; Both DualLanguageVersePart and VersePart implement the IVersePart interface. Both DualLanguageVersePart and ...

PHP - 'At' symbol before varable name: @$_POST

I've seen function calls preceded with an at symbol to switch off warnings. Today I was skimming some code and found this: $hn = @$_POST['hn']; What good will it do here? Edit: corrected my mistake in naming the symbol. Thanks for pointing it. ...

JavaScript Operator Precedence logic confuses me...

The operator precedence table I can find is: https://developer.mozilla.org/en/JavaScript/Reference/Operators/Operator_Precedence according to the table, both '>>' and '*' are left-to-right associate, and '>>' have higher precedence, so I think a >> b * c should explain as (a >> b) * c however, my test in Firefox (using Firebug), tell m...

String concatenation does not work in SQLite

I am trying to execute a SQlite replace function, but use another field in the function. select locationname + '<p>' from location; In this snip, the result is a list of 0s. I would have expected a string with the text from locationname and the '<p>' literals. ...

User selects operator from drop-down menu and use it in PHP function

Hi guys, What I would like to achieve here is a user selects an operator, e.g. +, >, <, >= etc. and uses this in a Select statement in PHP. MY HTML code: <label for="grade">Grade: </label> <select name="operator" id="operator"> <option value="">Select one</option> ...

Can you implement a dynamically created PSObject such that equality and comparison work?

I have been implementing makeshift types by dynamically adding methods to PSObjects I want to be able to compare two instances of my objects using the "-eq" "-lt" and "-gt" operators (I assume this would require me to implement interfaces like IComparible, and IEquatible) Is this sort of thing possible? (I'm thinking perhaps not as the...

PHP Ternary operator clarification

I use the ternary operator quite often but I've not been able to find anything in the documentation about this and I've always wondered it. The following is a possible example: echo ($something->message ? $something->message : 'no message'); as you can see, if $something->message is correct, we return $something->message, but why wr...

SQL Select Statement with WHERE, AND, OR

Hi guys, I would like to perform a SELECT query with MySQL. My goal is to select all the dogs in a vet database that would be sex=male and fur=short and (color=black or size=big) Note: I want to select dogs that are either black or size are big. They don't have to fulfill the 2 requirements. They just need to fulfill either one. I have...

OTA for Operators

Does android offers the mobile operators the ability to push applications via OTA? Something similar to Blackberry's Virtual Preload? If so, what conditions can the operator pick? In a VPL you can select to what model the app is OTA push to and at what time. ...

Which operator delete?

Is there a difference between: operator delete(some_pointer); and delete some_pointer; and if so what is the difference and where one should use one and where the other version of this operator? Thanks. ...

Define a generic that implements the + operator

I have a problem I’m working on, currently it is working for ints but i want it to work for all classes that can be added using the + operator. Is there any way to define this in the generic? For example, public List<T> Foo<T>() where T : ISummable Is there any way to do this? EDIT: Performance of passing in a delegate to do the summ...

Can someone explain the ++ operator?

Possible Duplicate: C#: what is the difference between i++ and ++i? I see this operator (++) very often. I know what it does ultimately, but it seems like there's some rules I don't understand. For example, it seems to matter if you put it before or after the variable you're using it on. Can someone explain this? ...

Is this a safe way to implement a generic operator== and operator<?

After seeing this question, my first thought was that it'd be trivial to define generic equivalence and relational operators: #include <cstring> template<class T> bool operator==(const T& a, const T& b) { return std::memcmp(&a, &b, sizeof(T)) == 0; } template<class T> bool operator<(const T& a, const T& b) { return std::mem...

What does the ^ operator do?

Hello, I found this code in a web page for calculating the BMI (Body mass index), which value is: Weight/Height * Height, the result on the web page is obviously wrong so looking at the code I´ve found this operator. I supose they wanted to calculate the square of the height but this is not happening. The web page is: http://www.lore...

what is the meaning of == sign ?

Hi, I am trying to figure out what == sign means in this program? int main() { int x = 2, y = 6, z = 6; x = y == z; printf("%d", x); } ...

Meaning of () => Operator in C#, if it exists

Hello everybody, I read this interesting line here, in an answer by Jon Skeet. The interesting line is this, where he advocated using a delegate: Log.Info("I did something: {0}", () => action.GenerateDescription()); Question is, what is this ()=> operator, I wonder? I tried Googling it but since it's made of symbols Google couldn't b...

What is =& in PHP

look at this example and there is a line $client =& new xmlrpc_client('/xml-rpc', 'api.quicktate.com', 80); $client->return_type = 'xmlrpcvals'; what is the =& and what is the -> in $client->return_type mean ...

std::sort and std::unique problem with a struct

The following code: #include <vector> #include <algorithm> struct myStructDim { int nId; int dwHeight; int dwWidth; }; void main() { ::std::vector<myStructDim> m_vec_dim; ::std::sort(m_vec_dim.begin(), m_vec_dim.end()); m_vec_dim.erase( ::std::unique(m_vec_dim.begin(), m_vec_dim.end())...

php not equal to != and !==

ive always done this if($foo!==$bar) but i realize that if($foo!=$bar) is correct? but double = still works and has always worked for me, but whenever i search php operators i find no info on double = so i assume i've always have done this wrong but it works anyways. So i should change all my !== to != just for the sake of it? ...