Browsing 7239 questions and answers with Jon Skeet
imports doesn't do what I suspect you think it does - it doesn't actually import anything, but it says "When you're trying to resolve a package, if it doesn't support my actual target framework, pretend that I'm targeting these... more 6/20/2017 7:08:42 AM
Well yes - you're trying to pass three integer arguments to the constructor, but it accepts a DateTime value. You're not currently creating a DateTime value. All you need to do is change your constructor call to: var myprogram = new... more 6/20/2017 6:19:29 AM
The simplest approach is to count non-null values: g.Count(x => x != null) I'd suggest moving the ordering after the select so that you can avoid repeating yourself: select new { g.Key.OwnerId, g.Key.Year, DocCount = g.Count(x =>... more 6/19/2017 4:35:48 PM
You're creating a new instance of Stopwatch on each iteration - which means that _running will always be false when you call Stop. In addition: You should be using DateTime.UtcNow instead of DateTime.Now, otherwise you'll see a "change"... more 6/18/2017 4:45:09 PM
You can create such a delegate - but you'll only be able to refer to it as a Delegate because you don't know the actual type at compile-time. It requires creating the appropriate delegate type from Func<T> using MakeGenericType.... more 6/18/2017 7:39:47 AM
The Zone line of the europe file in the IANA time zone database contains this single line for the CET zone ID: Zone CET 1:00 C-Eur CE%sT Then the end recurrence of the C-Eur rule is this pair of lines: Rule C-Eur 1981 ... more 6/17/2017 8:55:50 PM
You can't (easily, anyway) access variables by name like that - but there's a much better solution, which is to create a collection of some kind - an array or a list, for example. I would suggest: Changing your St_test struct: Make it... more 6/17/2017 9:01:07 AM
Update: this will now be in Noda Time 2.3. No, there isn't anything representing this in Noda Time. It's a pretty odd kind of value, as in at least many time zones, the offset will vary over the year. I understand that sometimes we need... more 6/13/2017 8:08:50 PM
By default, DateTime.Parse converts to a "kind" of Local. (Print out outTime.Kind to verify that.) So it understands that the source is universal - but it's adjusting it to system local time. Note that culture has nothing to do with time... more 6/13/2017 6:31:39 PM
The Win32 GUI libraries terminate strings if they find a \0 character (U+0000, Unicode "null") in them. For example, if you had: MessageBox.Show("First part\0Second part"); then only First part would be displayed. There are at least... more 6/12/2017 5:54:51 PM