Browsing 7239 questions and answers with Jon Skeet
No, you can't rely on the order in a Dictionary. It's implementation-specific, and can change in unexpected ways. In this case, it sounds like really you should have a custom type instead, with Country, State, Name and Type... more 7/16/2015 5:48:35 AM
I wouldn't expect there to be. Each call should be independent - requiring the next call to not give the same result as the previous one means it's not as random, IMO. To take a smaller example, imagine we didn't have nextDouble but a... more 7/15/2015 8:10:30 PM
I would strongly urge you to perform the conversion the other way round: in your .NET code, perform the conversion (once) from local time to UTC, making sure you're really applying the right time zone. Then you can pass the UTC values to... more 7/15/2015 4:16:23 PM
In this call: Utils.RaisePropertyChangedWhenCollectionChanged(this, Collection, PropertyChanged, "Collection"); ... you're passing in the current value of PropertyChanged, which is a single no-op delegate. Instead, you want it to raise... more 7/15/2015 4:09:29 PM
It works the same way a return statement returning a value always works: The expression is evaluated (in this case faktor(tall - 1) * tall) The value is returned to the caller It can't possibly return before evaluating the expression,... more 7/15/2015 1:56:54 PM
You should change the declaration of out to be of type ByteArrayOutputStream rather than just OutputStream. Then you can call ByteArrayOutputStream.toByteArray() to get the bytes, and construct a ByteArrayInputStream wrapping that. As an... more 7/15/2015 1:29:21 PM
Sounds like you want to first project the strings to index/value pairs, then pick the elements with null values, and project to just the indexes: var nullIndexes = names.Select((value, index) => new { value, index }) ... more 7/15/2015 8:46:24 AM
Asset isn't a valid expression here, unless you've actually got a variable called Asset somewhere. You want to find out if the name of any property is Asset... and you want to do it on each object, not on the list itself: foreach (var... more 7/14/2015 6:39:46 PM
Most of the time it doesn't make any difference - and you should definitely code for readability more than anything else. However, curly braces can have an effect on performance, in a surprising way, although it's pretty unusual. Consider... more 7/14/2015 5:41:47 PM
It sounds like the problem is with the way you created your jar file - assuming you did it at the root of your class hierarchy (which you should) you should have used: jar -cvf testjar.jar org/gamelink/game/*.class ... as there... more 7/14/2015 5:20:51 PM