Browsing 7239 questions and answers with Jon Skeet
The closest you could get would be: byte[] DecorateByteArray(byte[] payload) => new byte[] { 0, 1, 2 } .Concat(payload) .Concat(new byte[] { 3, 4, 5 }) .ToArray(); That would be pretty inefficient though.... more 8/24/2016 3:30:46 PM
You're continuing to try to read from the server until it's closed the socket - whereas the server is waiting for another command from the client. Neither side is going to do anything, as they're waiting for the other. Basically, you need... more 8/24/2016 3:04:00 PM
It looks like your code is using Float.parseFloat. That doesn't use any locale settings. From the docs: Returns a new float initialized to the value represented by the specified String, as performed by the valueOf method of class... more 8/24/2016 6:22:04 AM
Why doAction(A) will be selected in this situation? Because it's the only applicable method. Overload resolution is performed at compile-time, based on the compile-time type of the arguments. The doAction(B) method isn't applicable,... more 8/23/2016 11:43:35 AM
Basically, false is earlier than true... think of them as false=0, true=1. This is in-keeping with the documentation for bool.CompareTo(bool). If you want to prioritize "true" values to the start, just use OrderByDescending instead. more 8/23/2016 6:37:22 AM
Unfortunately the PSModulePath modification required to make the cmdlets available to PowerShell only happens when the Google Cloud SDK is installed - not when it's just updated. The simplest fix for most people will be to uninstall and... more 8/22/2016 4:51:48 PM
The Compute Engine instance doesn't know about your Google user at all - it only knows about regular Windows accounts, and you don't have a Windows account on it. So, you need to create a Windows account on the instance, and then put that... more 8/22/2016 11:12:07 AM
The null conditional operator is an operator which results in an expression - it's not a statement. Your logic about Foo?.Invoke(this, EventArgs.Empty) being equivalent to null doesn't really hold, as it seems to assume a sort of... more 8/22/2016 8:23:18 AM
I currently have a method to see what type of object an input is and create a SQL input based on it Don't do that. Use parameterized SQL instead. You should not be trying to format your values for use in SQL. This is almost always... more 8/21/2016 7:00:02 AM
If you're using LINQ to Objects, I'd just write my own extension method. My Edulinq project has sample code for All, and adapting that is pretty simple: public static bool AnyAndAll<TSource>( this IEnumerable<TSource>... more 8/19/2016 1:09:23 PM