Browsing 7239 questions and answers with Jon Skeet
\ is used for escape sequences in text literals for C#. The compiler doesn't think it's the start of a comment: it thinks it's the start of an escape sequence. So you either need to use "\\" (i.e. the escape sequence for backslash) or @"\"... more 6/5/2017 4:24:11 PM
Because the java.lang.annotation package isn't the same as the java.lang package. They're simply different packages. Imagine if importing one package imported all the packages "under" it - then import java.*; would import almost... more 6/3/2017 7:55:05 AM
You can't - you can only accept strings. However, you can then parse those strings as integers. For example: static void Main(string[] args) { int[] intArgs = args.Select(int.Parse).ToArray(); // ... } Note that this will throw... more 6/2/2017 10:10:36 AM
It sounds like you're looking for something to normalize the months and days (and weeks?). The existing Normalize method deals with everything from "days downwards" (e.g. hours) so you can use that to start with: public static Period... more 6/1/2017 4:07:27 PM
It's explained by the remarks in the NextValue() documentation: If the calculated value of a counter depends on two counter reads, the first read operation returns 0.0. Resetting the performance counter properties to specify a... more 5/31/2017 9:27:59 AM
Assuming that you just want to add SpeechContext to your request, just add instances to the RecognitionConfig's SpeechContexts property: var context = new SpeechContext { Phrases = { "first", "second" } }; var config = new... more 5/31/2017 8:58:36 AM
Well we have no idea what ser.method does, but passing a disposed object into method seems like a bad idea to me. Basically, your "fix" is bad. There are three possibilities here (and probably others, but these are the main... more 5/31/2017 8:35:41 AM
You're using hh as the hours specifier. That's a 12-hour value, and "23" clearly falls outside that range. ("09" parses because it's in range.) Use HH instead: dateFormatter.dateFormat = "yyyy-MM-dd HH:mm:ss" more 5/30/2017 1:42:52 PM
You shouldn't be using StreamReader and StreamWriter - those are for text, and your content isn't text. Just use Stream instead: private async Task ReadStreamAsync(HttpContext context, string filePath) { using (var input =... more 5/30/2017 1:01:47 PM
Leaving the parsing error aside, this isn't going to achieve what you want to achieve. A DateTime value is always in the Gregorian calendar - trying to parse 31/04/1396 as a DateTime is never going to work because it's not a valid date in... more 5/26/2017 9:05:41 AM