Browsing 7239 questions and answers with Jon Skeet
This has nothing to do with the quotes - and everything to do with how much data you're writing. To demonstrate this, you can get rid of the writer and the loop entirely, and just use: pout.write(new byte[1024]); Or keep your existing... more 11/27/2014 1:23:33 PM
To use polymorphism, you'd introduce an abstract method in whatever the base class is for all your entities: public abstract class EntityBase { public abstract void GiveMeABetterName(); } (We don't know what you're trying to do,... more 11/27/2014 11:59:43 AM
The problem is that topAgents is dynamic - so your ToList() call is dynamic, and so is Select. That has issues that: you can't use lambda expressions for dynamic calls like this; dynamic calls don't find extension methods... more 11/27/2014 11:30:33 AM
From the Groovy Closures Formal Definition (Alternative Source): Closures always have a return value. The value may be specified via one or more explicit return statement in the closure body, or as the value of the last executed... more 11/27/2014 10:41:25 AM
I would strongly recommend that you separate the IO from the line handling entirely. Instead of making your processing code use a StreamReader, pass it either an IList<string> or an IEnumerable<string>... if you use... more 11/27/2014 10:25:27 AM
From the documentation of HMACSHA1: A Hash-based Message Authentication Code (HMAC) can be used to determine whether a message sent over an insecure channel has been tampered with, provided that the sender and receiver share a secret... more 11/27/2014 7:30:21 AM
No, there's no built in support for merging... and unless the types of value1 and value2 are int?, you may not be able to tell the difference between "not initialized" and "initialized to 0". (If they're properties, you could give them... more 11/27/2014 6:59:32 AM
Within a single string, it sounds like you should iterate over the characters in the string and keep a count of how many opening and how many closing braces you've seen. Something like this: int open = 0; for (int i = 0; i <... more 11/27/2014 6:56:28 AM
The warning should tell you what you can do - something like this (emphasis mine): 'OAuthRefreshToken.User' hides inherited member 'OAuthRefreshToken.User'. To make the current member override that implementation, add the override... more 11/26/2014 5:47:09 PM
This sounds like a pretty bizarre task, to be honest, but you could use: while (Math.Abs(value) >= 1) { value = value / 10; } That will go into an infinite loop if the input is infinity though - and you may well lose information... more 11/26/2014 5:34:09 PM