Browsing 7239 questions and answers with Jon Skeet
LINQ makes this easy: // Method group conversion List<myObject> sorted = myList.OrderByDescending(SortByThisValue).ToList(); // Lambda expression List<myObject> sorted = myList.OrderByDescending(x => SortByThisValue(x)) ... more 9/16/2013 4:40:25 PM
After training the network, the error rate is minimized to around 1%, i pass the test data and most of the time the output is produced something like this "5,07080020755566E-10" where i expect numbers from 0 to 1 and also it should be... more 9/16/2013 2:08:56 PM
The parent getInfo() is private but does that mean that the second call of printPerson() is prevented from finding the child getInfo() (which is public)? Yes. The subclass's getInfo() method is not overriding the superclass's one, as... more 9/16/2013 6:12:52 AM
Why is the 00 in the time being converted to 10 am? XmlConvert.ToDateTime(string) returns a DateTime with a Kind of Local - in other words, it's converting the UTC value to the equivalent system local time. Presumably you're in a time... more 9/16/2013 6:07:17 AM
Question: If we add more comments, does the program takes more time to execute? Why? No. Comments have no effect on execution. They will slow the compiler down a tiny bit - but even that should be imperceptible unless you have a... more 9/16/2013 5:54:21 AM
In the enqueue part, shouldn't it be correct to add the element and then notify? That part doesn't really matter, as you're in a synchronized method - the other threads won't get to run until you've left the enqueue method anyway.... more 9/16/2013 5:51:44 AM
The code you've posted doesn't actually do anything with the client connection, which makes it hard to help you. But yes, it's entirely possible for a server to handle multiple concurrent connections. My guess is that the problem is that... more 9/16/2013 5:46:23 AM
Objects, reference types are suppose to be immutable. Not all of them. Some, but not all. For example, String is immutable, but StringBuilder isn't. All arrays are mutable. What happens here when nums is set to nums2. The nums... more 9/15/2013 4:37:51 PM
This is what happens with signed integer overflow, basically. It's simpler to take byte as an example. A byte value is always in the range -128 to 127 (inclusive). So if you have a value of 127 (which is 0x7f) if you add 1, you get -128.... more 9/15/2013 3:25:07 PM