Browsing 7239 questions and answers with Jon Skeet
I don't believe there's anything within the .NET culture information which gives this information, no. If there were, it would be in DateTimeFormatInfo. If (as I suspect) you can't find what you're looking for within the .NET classes, you... more 11/10/2013 9:26:09 PM
I've searched around and I want to abort a thread and restart it, something who should be really simple but no one is answering. You can't - it's as simple as that. Once a thread has been successfully aborted (i.e. it really has... more 11/10/2013 9:23:15 PM
You should absolutely use base64 or possibly hex. (Either will work; base64 is more compact but harder for humans to read.) You claim "both variants work perfectly" but that's actually not true. If you use the first approach and data is... more 11/10/2013 8:26:03 PM
I suspect you're looking for Any: ... InfoList.Any(x => x.EntityTypeID == v.EntityTypeItemID) You can't use Contains, because you're looking for something which matches part of the item. (I'd also strongly discourage using public... more 11/10/2013 5:47:48 PM
The problem is that the compiler won't work out that this: if (hasWarranty == true) { ... } else if (hasWarranty == false) { ... } will always execute exactly one of those paths. It thinks you might get to the end of the if... more 11/10/2013 5:02:18 PM
I suspect the problem may be that after computing the hash of the stream, the stream is left at the end of the data... so when anything else reads from it later, there'll be no data. Try add this after the call to... more 11/9/2013 3:55:49 PM
The problem is that the add method is declared to return Add - but you're trying to assign the return value to a variable of type Mul. That's just not valid. If you change the declared type of sum to Add instead of mul, then that... more 11/9/2013 12:53:10 PM
I assume you mean Interlocked.Add(ref long, long)? If so, the documentation isn't exactly blatant, but it does explain it: Version Notes Silverlight for Windows Phone 64-bit members of the Interlocked class are present but not... more 11/9/2013 12:17:02 PM
You can declare it before the if statement, but with no assignment - and then make sure that you assign a value to it in both branches: TextWriter outFile; if (inFile.Peek() == -1 || inFile == null) { outFile =... more 11/9/2013 8:31:28 AM
I suspect you actually want: fileIndex++; if (fileIndex == fileArray.Length) { fileIndex = 0; } (I've changed the variable names to be more conventional at the same time.) Note the change of condition - if you're incrementing... more 11/8/2013 11:17:36 PM