Browsing 7239 questions and answers with Jon Skeet
If you look at the Javadoc for Space you'll see that the locales attribute is a String[] - so just provide the IDs of the locals: @Space(value = "id", dbVersion = 1, models = NewsVault.class, locales = { "en" }) more 1/20/2017 8:01:39 AM
Assuming you're using the Google.Protobuf nuget package, you can just use: using Google.Protobuf; ... byte[] bytes = fp.ToByteArray(); You need the using directive for Google.Protobuf to make the IMessage.ToByteArray extension method... more 1/19/2017 6:56:30 PM
That code will already work fine. The args parameter of parse is already of type String[] - the String... syntax just means that the compiler is allowed to convert this: parse("foo", "bar", "baz"); into parse(new String[] { "foo",... more 1/19/2017 8:42:35 AM
Firstly, I'd question the approach - it sounds like this single class is trying to do too many things. But if you really, really want to do it, I'd recommend static factory methods calling a private constructor: public class... more 1/19/2017 7:04:40 AM
How can i call Extension method ExtTest ? Instance methods will always be preferred over extension methods - the compiler only checks for extension methods after everything else has failed. In this case, the simplest approach is just... more 1/17/2017 3:26:51 PM
You're opening the file without closing it. Just open the stream separately so you can close it in a using statement: MD5 md5 = MD5.Create(); using (var stream = File.Open(...)) { var hash = md5.ComputeHash(stream); //... more 1/17/2017 11:38:59 AM
Is there a way without looping through each item in the list of dictionary value. Something has to loop - dictionaries are only designed to look up by key, and you're not doing that other than for the first check. You can do this... more 1/17/2017 7:16:43 AM
Your format string is "#/100;-#/100;0". That's a very strange format string. You're saying: If the number is positive, use a format of "#/100". If the number is negative, use a format of "-#/100". If the number is zero, use a format of... more 1/16/2017 9:41:08 PM
There are four problems with your code to start with: You're using the system default time zone when you use Calendar, which may well change which date the Instant falls on. If you set the calendar to use UTC you'll make it more... more 1/16/2017 9:58:56 AM
All your async methods return void - that means they start executing, and the calling code has no easy way of waiting until it's actually completed before continuing. As soon as your use an await expression on something that hasn't... more 1/15/2017 6:33:24 PM