Browsing 7239 questions and answers with Jon Skeet
Assuming you always want Monday to Sunday, you just need something like: DateTime today = DateTime.Today; int currentDayOfWeek = (int) today.DayOfWeek; DateTime sunday = today.AddDays(-currentDayOfWeek); DateTime monday =... more 11/4/2015 4:15:08 PM
A GroupJoin operation first needs to build a lookup - basically from each projected key in inner to the elements of inner with that key. That's why you're being passed inner values. This happens lazily in terms of "when the first result is... more 11/4/2015 2:08:18 PM
Each time you call read(byte[]), it will: Block until at least one byte is read from the input, or the input is closed Copy bytes from the input into the array, starting at index 0 of the array Return when there are no more bytes... more 11/4/2015 12:46:44 PM
Looking at the predicate string format, it looks like & isn't a valid operator. You either want AND or &&. So: @"claimID != '' && userID = %@" or @"claimID != '' AND userID = %@" (This may well not be the only... more 11/4/2015 12:24:48 PM
The problem is that you're adding the wrong namespace... you're trying to use the alias for it, instead of the namespace URI. Here's a concrete example that works: using System; using System.Xml.Linq; class Program { static void... more 11/4/2015 11:26:17 AM
You're starting three threads. Each of those will call call on the same Callme, so only one thread will be executing call at a time... but that doesn't mean that the threads will execute in the order that you started them. Imagine you... more 11/4/2015 10:46:01 AM
It's not that a ParseException is being thrown - the problem is that the compiler is complaining because you're calling parse which can throw a ParseException, and you're not handling it. ParseException is a checked exception, which means... more 11/4/2015 10:39:28 AM
My other method will then add the number to each element in the array That's not what it's doing at the moment. It's modifying each "diagonal" element. Imagine that you have a 5 x 10 array... you're currently only modifying 5 entries.... more 11/4/2015 9:46:53 AM
It sounds like you should start with a List<string> (or possibly a List<int>, given that they all seem to be integers...) rather than populating your map with empty entries to start with. So something like: List<string>... more 11/4/2015 9:36:00 AM
should I use a field or a property when a property would simply use get;set;? Use a property... for the practical reasons below, and for the philosophical reasons that properties expose a state API, whereas fields expose a state... more 11/4/2015 8:09:57 AM