Browsing 7239 questions and answers with Jon Skeet
How do you set the created provider to the NodaTime library in order to use it as a default? Very few things in Noda Time use any provider as the default. (Similarly we don't use the system time zone by default, and try to avoid... more 9/2/2016 6:23:50 AM
Yes, the binary + operator isn't defined on char, so you end up with implicit conversions to int. You can use a pre/post-increment operator: char x = 'A'; x++; ... because the ++ operator is defined for char. But otherwise, you need a... more 9/1/2016 5:13:34 PM
No, you have a single timer - but you're adding an event handler to it every time you click start: query1Timer.Elapsed += new ElapsedEventHandler(doQuery1); Just move that line into wherever you construct the timer, so it only gets... more 8/31/2016 1:56:39 PM
responseLength is -1 allways but result.Length has some value, is that correct? Well it may be for some web sites (or some responses in some web sites) - in other cases, you'll see a non-negative value for responseLength. All you're... more 8/31/2016 1:27:50 PM
In your first example, you're using "regular" C# syntax to call a bunch of extension methods: var sample = db.Database .OrderByDescending(x => x.RecordId) .Select(y => y.RecordId) ... more 8/31/2016 8:55:00 AM
Basically, the way method invocation works in C# is that the compiler looks at the most derived class first, and sees whether any newly declared methods (not including overrides) are applicable for the arguments for the call. If there's at... more 8/30/2016 5:38:21 PM
Basically, you've misunderstood how this line works: Test obj2 = ++obj; If you think of using your operator as a method, that's like saying: obj = Test.operator++(obj); obj2 = obj; So yes, you end up with obj and obj2 being the same... more 8/30/2016 10:14:23 AM
I would stick to Noda Time types as far as possible (and .NET naming conventions). The conversion between zones should be done with ZonedDateTime.WithZone - which means you're really asking about converting to and from ZonedDateTime. If... more 8/30/2016 7:07:55 AM
If you tell Parallel.ForEach about the CancellationToken, it can stop processing when the token is cancelled. You may not want to throw an exception from your loop - you may just want to ignore the cancellation token yourself, and just... more 8/28/2016 4:12:31 PM
This is basically a bug in File.ReadLines, not Take. ReadLines returns an IEnumerable<T>, which should logically be lazy, but it eagerly opens the file. Unless you actually iterate over the return value, you have nothing to... more 8/25/2016 10:34:20 AM