Browsing 7239 questions and answers with Jon Skeet
You're trying to start the task returned by the async method - that isn't the cold task that you started out with. Indeed, if you add some diagnostics to your Task.Run call, you'll see that an exception is thrown: ... more 6/16/2014 5:51:26 AM
Two problems: You're using the platform-default encoding in both C# and Java. That's almost always a bad choice. Specify the encoding explicitly in Java - UTF-8 is usually a good choice. (That's also the default for most .NET... more 6/15/2014 7:59:06 PM
You haven't shown where you've declared random, but I suspect you've used: Random random; whereas you actually want the type of random to be float: float random; ... random = Random.Range(0f, 5f); Alternatively, declare the variable... more 6/15/2014 1:34:43 PM
There's no such concept of unshuffling - after you've shuffled a deck of cards, how would you get back to the previous state, for example? If your original collection is ordered in some definitive way, just sort it again. Otherwise (e.g.... more 6/14/2014 5:01:35 PM
Just use the size of the list (it's not an array): if (x.size() <= index || x.get(index) == null) { ... } Or if you want to detect a valid index with a non-null value, you'd use: if (index < x.size() && x.get(index)... more 6/14/2014 4:27:37 PM
I think it's explained by this part of RFC 4234: ABNF strings are case-insensitive and the character set for these strings is us-ascii. Hence: rulename = "abc" and: rulename = "aBc" will match "abc", "Abc",... more 6/13/2014 10:11:50 PM
It sounds like you just want: // No need to specify "Issue" if that's all that's in myXML. Prefer explicit // attribute conversion over "manual" parsing var orderedIssues = myXML.Elements().OrderBy(x => (int)... more 6/13/2014 2:25:01 PM
It sounds like you just want: Node cdata = doc.createCDATASection(text); parentElement.appendChild(cdata); more 6/13/2014 2:23:03 PM
Three independent options: Ditch the anonymous type entirely. You've only got a single value, so why not use select p.PRESSRELEASEID? Cast in the select clause: select (object) new { ITEMID = p.PRESSRELEASEID } Declare the variable... more 6/13/2014 1:48:09 PM
Basically, it's part of the C# language specification: there's syntax for string literals, numeric literals, character literals and Boolean literals, but that's all. The compiler uses these literals to generate IL, and for most of them,... more 6/13/2014 1:30:35 PM