Browsing 7239 questions and answers with Jon Skeet
The condition tch2.WeekEndingDate = @PayPeriod doesn't feel like part of the join to me - it's not comparing data in two different rows. It feels like it should be part of what you're joining on, leading to: join leftth2 in... more 9/27/2016 3:39:11 PM
Each byte of data in LEB only accounts for 7 bits in the actual output - the remaining bit is used to indicate whether or not it's the end. From Wikipedia: To encode an unsigned number using unsigned LEB128 first represent the number... more 9/27/2016 12:54:18 PM
You're calling getDeclaredMethod on the actual type of cd, whereas it's declared in CharsetDecoder. That can't be the actual type of cd given that it's an abstract class. Just change this: Class c = cd.getClass(); to Class c =... more 9/26/2016 12:35:49 PM
XML 1.1 allows for all Unicode characters other than U+0000, but XML 1.0 has a restricted character set. From section 2.2 of the 5th edition: Char ::= #x9 | #xA | #xD | [#x20-#xD7FF] | [#xE000-#xFFFD] | [#x10000-#x10FFFF] That's the... more 9/26/2016 9:17:27 AM
You're using the synchronous Stream.CopyTo method here: httpStream.CopyTo(fileStream); I think you just want: await httpStream.CopyToAsync(fileStream); However, you should also remove the StreamReader part - you're not using the... more 9/26/2016 7:21:53 AM
No, the existing items aren't affected, other than being potentially eligible for garbage collection. This is just like setting a variable to null, effectively: MyDataObject x = new MyDataObject(); // And populate MyDataObject y = x; //... more 9/26/2016 5:54:24 AM
Well, two options: Conditionally apply the Where clause: IQuerable<StudentModel> students = repository.Students.Select(m => new StudentViewModel { Id = m.Id, Name = m.Name }); if (!string.IsNullOrEmpty(query)) { ... more 9/25/2016 5:12:55 PM
Assuming you've got a suitable constructor, it should be as simple as: List<Person> people = employees .stream() // View the list as a stream .map(e -> new Person(e.getId(), e.getName(), e.getRole().getSalary())) ... more 9/25/2016 7:48:11 AM
I think you're confused about what your methods are doing, and when you're initializing objects. I suspect you actually want to do something like this: class Program { static void Main(string[] args) { // Ask the user for... more 9/23/2016 1:40:57 PM
One simple option which avoids needing to worry about file locations is to embed the certificate within your assembly. In Visual Studio, right-click on the file and show its properties. Under Build Action, pick "Embedded resource". You... more 9/23/2016 12:59:57 PM