Browsing 7239 questions and answers with Jon Skeet
Why can't I initialize my variable "pDll"? The compiler is telling you exactly why - you can't access instance fields within an instance field initializer. It looks like these should probably be static anyway: static readonly string... more 8/25/2015 2:13:29 PM
You can write a static method to do this: import java.util.function.*; class Test { public static void main(String[] args) { Function<String, Integer> function = combine(String::length, n -> n * 2); ... more 8/25/2015 2:08:09 PM
It looks like you're missing a NuGet package - you should install the Google.Apis.Storage.v1 package in your project. After that, you should be able to add a using directive of using Google.Apis.Storage.v1; ... and use code of: var... more 8/25/2015 11:42:59 AM
My guess is that the problem is that it's not populating the varargs parameter. Try: Path target = Paths.get(filename, new String[0]); more 8/25/2015 10:55:34 AM
Presumably because you're executing it in an unchecked context. Arithmetic on the primitive integer types can execute in a checked or unchecked context. Operations which overflow throw an exception in a checked context, and just use the... more 8/25/2015 10:41:13 AM
Firstly, don't do this. Don't try to initialize the input stream until you've got data in the file. As for why it's working when you don't buffer, I believe the problem is with the buffering of the output stream... in the buffered... more 8/25/2015 6:11:16 AM
I'll assume your code is actually not quite as presented, given that it wouldn't currently compile - you're using cmdR before you declare it. First, you're trying to use named parameters, and according to the documentation of... more 8/25/2015 5:56:13 AM
Well, maps are already supported in "protobuf proper" as of v3.0. For example, your proto is effectively: message Dictionary { map<string, string> pairs = 1; } The good news is that with the key and value fields you've... more 8/24/2015 4:36:01 PM
I would strongly recommend only using \u, as it's much less error-prone. \x consumes 1-4 characters, so long as they're hex digits - whereas \u must always be followed by 4 hex digits. From the C# 5 specification, section 2.4.4.4, the... more 8/24/2015 6:13:36 AM
Your call to date_create_from_format includes an A at the end of the format string - that looks specious to me, given that your value doesn't end with am or pm. Your use of h looks unlikely to be correct too, as that's for a 12-hour... more 8/24/2015 6:08:49 AM