Browsing 7239 questions and answers with Jon Skeet
Those are all types generated by the compiler. The C# compiler generates types to implement things like: Lambda expressions and anonymous methods Iterator blocks Async methods Anonymous types All of them should have the... more 3/28/2017 11:23:13 AM
I presume you could create the Ninja asynchronously through some kind of static factory method, but then you run the risk (at least theoretically) of the Ninja not being ready (i.e. a null object) to attack when called to do so by the... more 3/26/2017 8:49:14 AM
No, it doesn't. Thread-safety and type-safety issues aside, I can very easily get two different instances of Customer: Customer x = Customer.getInstance("first"); Customer y = Customer.getInstance("second"); System.out.println(x == y); //... more 3/26/2017 8:46:01 AM
If you're using .NET Core, you're probably using a beta of 2.0. (I'm hoping to release 2.0 within a week.) The week-of-week-year handling has been overhauled for 2.0. In 2.0 you'd use: return... more 3/24/2017 2:56:23 PM
It's not clear why you've got two loops here. You always want the same two elements for each row - index 1 and index 2. So you just need: for (var x = 1; x <= reportValue.GetLength(0); x++) { var id = reportValue[x, 1]; var... more 3/24/2017 2:40:57 PM
It means you can stream to arbitrary destinations rather than just to memory. If you want to write something to a file, why would you want to create a complete copy in memory first? In some cases that could cause you to use a lot of extra... more 3/24/2017 1:26:52 PM
In addition to Chris's answer, other things to note when using BigQuery from Container Engine: Assuming your cluster has been initialized with the right scopes, you should be able to use Application Default Credentials from Container... more 3/24/2017 7:30:10 AM
It sounds like you're seeing a breaking change in NuGet 3.4 A zero in the fourth part of the version number will be omitted 1.0.0.0 is treated as 1.0.0 1.0.01.0 is treated as 1.0.1 It's hard to know exactly what to suggest here,... more 3/23/2017 7:22:09 PM
It seems to me that the right approach is to change your design - instead of asking for the months between one date and another, you should add the relevant number of months to your original DateTime. You don't need a helper method for... more 3/23/2017 11:36:37 AM
Well, your expectations are incorrect. Basically, the JSON deserializer is - entirely reasonably, IMO - executing code equivalent to: var student = new Student { Name = "ABC", Subjects = { // Each line here will just... more 3/22/2017 2:28:46 PM