Browsing 7239 questions and answers with Jon Skeet
It sounds like you basically want overload resolution at execution time. (I'm assuming you can't introduce a virtual method to do the right thing, and implement it in each class. That would be the cleanest way if it's reasonable for the... more 6/17/2015 4:27:51 PM
Yes, it will be evaluated twice. It can't know that it is the same value. For example: Random rng = new Random(); Console.WriteLine($"{rng.Next(5)}, {rng.Next(5)}, {rng.Next(5)}"); It's exactly the same as if you just used the... more 6/17/2015 4:14:19 PM
Array is just a helper class - note how all the methods on it are static. I wouldn't expect there to ever be an instance of it. To accept an array - and any array, including int[] etc - you'd need to make the method accept Object: public... more 6/17/2015 1:28:50 PM
This line: first = first.nextLink is modifying a field, even though you're meant to just be looping to find the right link. That seems like a very odd thing to do. I'd expect to have something like: public void deleteLinkNumber(int... more 6/17/2015 6:25:17 AM
A few options: Your ajax call could return an encrypted form of the data, and the client side could decrypt it. Your ajax call could include some sort of token which was originally provided on the single accessible page, and you could... more 6/17/2015 6:09:08 AM
Currently you're just returning the decimal representation of all the bytes, concatenated together. So { 0, 0, 0 } ends up as "000" whereas { 123, 123, 123 } ends up as "123123123". So yes, both those hashes will give the same output size... more 6/17/2015 5:58:05 AM
You have an unconditional else block - you can't follow that with another else. So this is fine: if (condition) { ... } else if (otherCondition) { ... } else { ... } But this isn't - because it doesn't make sense: if... more 6/16/2015 6:12:01 PM
I am getting the error that this is not valid in a static property. Indeed. In fact, in this case, it's a static method. A static member is one which is associated with the type, rather than with any instance of the type - so here,... more 6/16/2015 6:09:53 PM
The C# code contains doubled backslashes in the connection strings, because that's needed to escape them in string literals (or using a verbatim string literal). In VB that's not needed as \ isn't an escape character (as far as I'm aware)... more 6/16/2015 4:19:50 PM
You've created a single Hashtable outside your loop, then one on every iteration inside your loop. However, you're unconditionally adding to the single "outer" hashtable within the loop, so on the second iteration it's bound to... more 6/16/2015 4:08:33 PM