Browsing 7239 questions and answers with Jon Skeet
You're calling setDay first, before you call setMonth or setYear... which means setDay doesn't know which month and year you're talking about. It can't possibly validate that the day is correct without that information. You could just... more 12/17/2014 3:21:26 PM
When you've got arbitrary binary data, never ever try to convert it to a string as if it's actually text data which has been encoded into binary data using a normal encoding such as UTF-8. (Even when you do have text data, always specify... more 12/17/2014 3:10:21 PM
The problem is how you're using sha1sum under Linux with echo. It's including the line feed. To split it into steps: echo test > somefile sha1sum somefile will show you the same result... but if you look at somefile you'll see it's 5... more 12/17/2014 1:52:26 PM
(This is a duplicate of similar posts, but they're often quite hard to find and the symptoms often differ slightly.) The problem is that you're capturing the variable i in your loop: for(int i = 0; i < count; i++) { tasks[i] =... more 12/17/2014 1:38:44 PM
You only need to wrap the calling code in a try/catch block where you're asking for the result, or waiting for the task to complete - those are the situations in which the exception is thrown. The code creating the task won't throw that... more 12/17/2014 1:23:28 PM
Your date formats are using the system default time zone. That's okay for your input, because it specifies the UTC offset explicitly - but for your output, you've just got a date. So it's showing you the date that that point in time... more 12/17/2014 11:22:47 AM
That's fairly reasonable if the user is in a different locale - you should ask your customer what their system locale is. Use the invariant culture if you want a machine-readable format. For example: String^ value =... more 12/17/2014 10:51:19 AM
I would recommend parsing it as a DateTimeOffset instead of as a DateTime. You can then get the DateTime out of that, but it separates the "parsing the data you've been given" step from the "only using the bits I want from that"... more 12/17/2014 9:12:02 AM
Your section code snippet is failing because when you reach the end of the first using statement: using (Stream stream = entry.Open()) { metaDataStream = stream; } ... the stream will be disposed.... more 12/16/2014 4:16:16 PM
Double.Epsilon is the smallest positive representable value. Just because it's representable on its own does not mean it's the smallest value between any other representable value and the next highest one. Imagine you had a system to... more 12/16/2014 2:13:10 PM