Browsing 7239 questions and answers with Jon Skeet
In C++, the condition in an if statement doesn't have to be a Boolean expression - but it does in C#. You just need to check for the result being non-zero: if ((fromPos.y & 0x40) != 0) (The brackets are required due to precedence;... more 10/19/2014 7:16:50 AM
You're not telling it that it should accept a currency value. To do that, you need to call an overload which accepts a NumberStyles value, and include NumberStyles.AllowCurrencySymbol. For example: using System; using... more 10/18/2014 5:10:34 PM
To answer the final question, as it sounds like you actually understand why the test fails... IEEE-754 has a neat property that if you take adjacent bitwise values, those end up being adjacent representable double values. So you can find... more 10/18/2014 4:42:16 PM
There are two problems - one explaining why you're only using the first input number, and one explaining why you're only comparing it against one random number. For the random number part, here's the problem: Seed =... more 10/18/2014 4:16:38 PM
You're not using decimal - you're using double. Use decimal everywhere (so moneyIn should be a decimal too). If you're actually using 999.00m for moneyIn, that would make it a decimal and your current code wouldn't even compile (as there... more 10/18/2014 9:52:43 AM
I've just tried the code in the quickstart guide and it worked without any problems at all, using the Google.Apis.Drive.v2 nuget package. As you say, there are lots of different approaches to auth and the code in the quckstart isn't... more 10/18/2014 7:40:15 AM
Just remove the int part of int sumOfGames += value; So it becomes sumOfGames += value; You can't use a compound assignment operator in a variable declaration - the whole point of a compound assignment operator is that it uses the... more 10/17/2014 4:37:27 PM
Here's the problematic code: userInput = getUserInput(userInput); userInput is assigned after that statement, but think of it this way: int tmp = getUserInput(userInput); userInput = tmp; Nothing has assigned a value to userInput... more 10/17/2014 3:39:09 PM
The problem is that you've got two methods with the same signature. The simplest fix to this is just to remove the final parameter from the second overload, and just call the first overload with a hard-coded value for the last... more 10/17/2014 2:19:24 PM
You'll get an InterruptedException if the thread calling join is interrupted while waiting for the other one to die. That's not what happens in your case - you're interrupting the thread you're joining which is an entirely different... more 10/17/2014 12:52:11 PM