THis is for MSVC
#define Get64B(hi, lo) ((((__int64)(hi)) << 32) | (unsigned int)(lo))
Specifically, what is the role of the 'operator <<' ?
Thanks for your help
i am doing:
html = new WebClient().DownloadString("http://www.google.com/search?sourceid=chrome&ie=UTF-8&q=" + biocompany);
and i am getting the error:
Error 1 Operator '&' cannot be applied to operands of type 'string' and 'string'
but i am not even using the & !
please help!
I have a struct like this, with an explicit conversion to float:
struct TwFix32
{
public static explicit operator float(TwFix32 x) { ... }
}
I can convert a TwFix32 to int with a single explicit cast: (int)fix32
But to convert it to decimal, I have to use two casts: (decimal)(float)fix32
There is no implicit conversion from float to either int or decimal. Why does the compiler let me omit the intermediate cast to float when I'm going to int, but not when I'm going to decimal?
To check if a type is a subclass of another type in C#, it's easy:
typeof (SubClass).IsSubclassOf(BaseClass); // returns true
However, this will fail:
typeof (BaseClass).IsSubclassOf(BaseClass); // returns false
Is there any way to check whether a type is either a subclass OR of the base class itself, without using an OR operator or using an extension method?
I have an 'optional' parameter on a method that is a KeyValuePair. I wanted an overload that passes null to the core method for this parameter, but in the core method, when I want to check if the KeyValuePair is null, I get the following error:
Operator '!=' cannot be applied to operands of type System.Collections.Generic.KeyValuePair<string,object>' and '<null>.
How can I not be allowed to check if an object is null?
I'm scraping data from the web, and I have several processes of my scraper running in parallel.
I want the output of each of these processes to end up in the same file. As long as lines of text remain intact, I the order of the lines does not matter. In UNIX, can I just pipe the output of each process to the same file using the operator?
For a little while now javascript has the "map" function to loop over arrays.
It appears possible to use it as a 'foreach' operator for example:
var arr = ['a','b','c']
var doubles = arr.map(function(val){
return val + val
})
Is this better or worse than saying
for(var i in arr){ ...
50/50: saves having to use the index but adds a callback; it doesn't seem very common so I hesitate to use it but still want to.
Possible Duplicate:
GOTO still considered harmful?
I have read articles that advise on refraining from using the goto operator frequently, but never told why. I have googled this for ever and can't really find anything.
I've been reading a couple books/online references about compiler theory, and keep seeing that particular operator coming up every once in a while (as seen here), specifically when the current topic is context free grammars. What does it mean? As well, how does it differ from =>?
Explanations with examples distinguishing => from =*> would be most helpful.
i was trying to call a static function of class using scope resolution operator, the way to access static function but still generating error. what are the possibilities.
I'm writing a script to download a bunch of files, and I want it to inform when a particular file doesn't exist.
r=`wget -q www.someurl.com`
if [ $r -ne 0 ]
then echo "Not there"
else echo "OK"
fi
But it gives the following error on execution:
./file: line 2: [: -ne: unary operator expected
What's wrong?
What i want to do is
for (list<cPacket *>::iterator i = cache.begin(); i != cache.end(); i++){
if( strcmp(i->getName(),id) == 0 ){
return true;
}
}
where getName is function of the class cPacket, But it does not work, i tries also
i.operator->()->getName(), and again nothing.
Can anybody help me?
Happily reading xml with
var q2 = from c in xmlDoc.Descendants("Ticket")
select new
{ Responded_Date = (DateTime)c.Element("Responded_Date") }
However when the tag is
<Responded_Date xsi:nil="true" />
I get "String was not recognized as a valid DateTime". I don't wish to use the null coalescing operator but simply to take the null and insert into datatable
These questions are a kind of game, and I did not find the solution for them.
It is possible to write ::: in C++ without using quotes or anything like this and the compiler will accept it (macros are prohibited too).
And the same is true for C# too, but in C#, you have to write ???.
I think C++ will use the :: scope operator and C# will use ? : , but I do not know the answers to them.
Any idea?
i was learning about c++ pointers... so the "-" operator seemed strange to me... instead of
ptr-hello();
one could write
(*ptr).hello();
because it also seems to work, so i thought the former is just a more convenient way
is that the case or is there any difference?
I am looking for a functor that deletes its argument:
template<class T>
struct delete_functor
{
void operator()(T* p)
{
delete p;
}
};
Is there something like this in std, tr1 or boost?
hello i have problem with receiving data from serial port in c# in am inserting a new line operator at the end of data buffer. then i send this data buffer on serial port, after this my c# GUI receiver will take this data via Readline() function but it always give me raw data not the actual one how to resolve this problem.
A popular editor uses highlighting to help programmers avoid using C++ keywords in Java. The following words are displayed using the same colors as a syntax error:
auto delete extern friend inline redeclared register signed sizeof
struct template typedef union unsigned operator
Why would this be considered important?
Hi,
in bash I need to compare two float numbers, one which I define in the script and the other read as paramter, for that I do:
if [[ $aff -gt 0 ]]
then
a=b
echo "xxx "$aff
#echo $CX $CY $CZ $aff
fi
but I get the error:
[[: -309.585300: syntax error: invalid arithmetic operator (error token is ".585300")
What is wrong?
Thanks
I have an object which has both a copy constructor and assignment operator defined. It is enclosed inside a shared pointer.
I want to make another shared pointer that contains a copy of the original shared pointer (i.e. new shared pointer to a new memory location, which however, has the same data as the original object).
Thanks for any assistance.
updated_date = 08-Jun-2010;
I have a query like this
select * from asd whre updated_date <= todate('08-Jun-2010', 'dd-MM-yy');
but i am not getting any result. it is wotking only if todate is 09-Jun-2010...
ie my equalto operator is not working properly.
y is it like that
ny help?
Why does equality operator return false in the first case?
var a = new Date(2010, 10, 10);
var b = new Date(2010, 10, 10);
alert(a == b); // <- returns false
alert(a.getTime() == b.getTime()); // returns true
Why?
The pipe operator in prolog returns one or more atomic Heads and a Tail list.
?- [a,b,c] = [a,b|[c]].
true.
Nesting multiple pipes in a single match can be done similar to this:
?- [a,b,c] = [a|[b|[c]]].
true.
What does the statement [a|b|c] infer about a, b and c?
In Javascript I can do this:
function A(x) { return x || 3; }
This returns 3 if x is a "non-truthful" value like 0, null, false, and it returns x otherwise. This is useful for empty arguments, e.g. I can do A() and it will evaluate as 3.
Does Python have an equivalent? I guess I could make one out of the ternary operator a if b else c but was wondering what people use for this.
I'm trying to rename the columns. The syntax should be the column name between double quotes incase of two words, like this:
SELECT p_Name "Product Name" from items
So I'm trying to do it in C# code like this:
string sqlqry1 = "SELECT p_Name \"Prodcut Name\" from items";
But I get an error:
Syntax error (missing operator) in query expression 'p_Name "Prodcut Name"'.
It seems am having somthing wrong with the quotes, but I can't figure out.