Browsing 7239 questions and answers with Jon Skeet
Yes, because it's the output of the other process. You're only able to read from it. From the documentation. Gets a stream used to read the output of the application. I know it's a bit confusing, but think of it as StandardOutput... more 7/23/2014 2:39:24 PM
Well, it looks to me like minuteAverage.Key.Subtract(new TimeSpan(0, i, 0)) doesn't depend on anything within the loop. So extract that: var target = minuteAverage.Key.Subtract(new TimeSpan(0, i, 0)); var avrPrefMinute =... more 7/23/2014 9:12:53 AM
Just call the toByteArray method on the message: byte[] content = clientMessage.toByteArray(); more 7/23/2014 5:48:21 AM
It sounds like you just need == null: var current = enumerator.Current; if (current == null) { sb.Append("null"); } else { sb.Append(current); } Or more compactly: var current = enumerator.Current; sb.Append(current == null ?... more 7/22/2014 2:57:26 PM
Why does the javac not give an unchecked cast warning? Because there are no generics involved. I don't think "unchecked cast" means what you think it means. It's for situations like: List<?> list =... more 7/22/2014 2:55:42 PM
Given that it looks like you're using LINQ to XML, you don't need to do any of the parsing manually. Just use the conversions to DateTime: XElement forecastDateElement = xFore.Root.Element("forecastDateLocalStr"); DateTime forecastDate =... more 7/22/2014 1:48:28 PM
No, you can't use a method reference because you need to provide an argument, and because the startsWith method doesn't accept the value you're trying to predicate. You could write your own method, as: private static boolean... more 7/22/2014 12:21:16 PM
Don't use Random at all for something as sensitive as this. Use RNGCryptoServiceProvider instead, which provides reasonably secure seeding. It's not as simple an API to use as Random - you basically just get bytes, potentially guaranteed... more 7/22/2014 11:56:03 AM
Well, you could use Enumerable.Range to iterate over all the relevant positions in the arrays, and then Sum to sum all the values for each position: // Variable names changed to follow normal C# conventions var size =... more 7/22/2014 7:25:37 AM
You've got two instances, referred to by variables instance and instance2. These are the only lines of your code which use instance2: TrippelTylerScientificMemoryCalculator instance2 = new ... more 7/22/2014 6:05:04 AM