Browsing 7239 questions and answers with Jon Skeet
I believe the problem is that you're using org.json.alt.JSONArray instead of org.json.JSONArray. I'm not familiar with that class, but I suspect JSONObject.put is just calling toString() on it rather than treating it as an existing JSON... more 5/11/2018 3:48:02 PM
There are a few issues in the tests, but after changing those a little, they pass with the code below. In principle, it's a matter of: Take the interval, and work out the dates that might be within it for any time zone. We can just... more 5/11/2018 9:34:14 AM
It sounds like you just want: var local = LocalDateTime.FromDateTime(myDateTime); var zone = DateTimeZoneProviders.Tzdb[id]; var zoned = local.InZoneLeniently(zone); Except: You may well want to write your own rules instead of using... more 4/26/2018 5:12:38 PM
If you use params and specify arguments in that way then yes, it will always create an array object. If you want to avoid that, and if you don't need to worry about recursion or thread safety, you could keep a List<GameObject>... more 4/21/2018 7:45:11 AM
I would do this in two passes: Use a regular expression to extract the dates if they're present at all. Use DateTime.TryParseExact to check that each date really is a date. I would recommend against trying to do full date validation in... more 4/21/2018 7:18:12 AM
The dictionary doesn't use the object's location in memory to do book-keeping - it uses the hash code. The hash code of an object doesn't change when the object is moved in memory, even if it doesn't override GetHashCode(). The details... more 4/21/2018 6:47:27 AM
As has been noted in other answers, the laziness of Select is the problem here. I'd add that more broadly, using side-effects (such as appending to a StringBuilder) is generally a bad idea within a LINQ query. Each selector, condition etc... more 4/12/2018 6:32:01 AM
You want to use ServiceAccountCredential, with a User property set to the appropriate user. Assuming you're loading the credentials using GoogleCredential, this isn't too hard. For example: GoogleCredential credential =... more 4/3/2018 3:08:59 PM
As per comments and other answers, you can use LINQ for both of these. (Although you don't have to; farbiondriven's answer will work absolutely fine, although it's less general purpose in that LINQ solutions can handle any... more 4/3/2018 2:04:51 PM
WithIsoIntervalConverter replaces the converter for the Interval type. WithIsoDateIntervalConverter replaces the converter for the DateInterval type. If you're not using Interval or DateInterval, you won't care what the converter does... more 4/2/2018 3:15:30 PM