Browsing 7239 questions and answers with Jon Skeet
You're calling b1.equals(b3) - b1 is an instance of Base, not of Sub, so there's no way your overriding method can be called. Heck, even b3.equals(b1) won't call anything on Sub, as b3 refers to an instance of Base as well. Only b4 and... more 7/4/2014 10:55:51 AM
It's more general than "inside loops" - it's any time you want to do concatenation over multiple statements, and don't need the intermediate result as a string. For example: StringBuilder builder = new StringBuilder("Start"); if... more 7/4/2014 9:55:23 AM
I think you've misunderstood the purpose of setFirstDayOfWeek. That doesn't change c.get(Calendar.DAY_OF_WEEK) works at all - it changes the result of calling c.get(Calendar.WEEK_OF_MONTH) and c.get(Calendar.WEEK_OF_YEAR), as per the... more 7/3/2014 1:00:46 PM
You just need to specify the locale when you create the SimpleDateFormat: SimpleDateFormat sdf = new SimpleDateFormat("MMM", Locale.US); Note that using one specific Locale for all users is typically appropriate for machine-to-machine... more 7/3/2014 10:08:54 AM
Firstly, both of your snippets are broken. Your're calling read without taking any notice of the return value. There could be more data to be read, and it may very well not have filled the buffer... but you're using the whole buffer... more 7/3/2014 9:39:49 AM
I don't know anything about the UI side of things (I don't know which date picker you're using, or whether it supports alternative calendars), but... if you've got a DateTime value representing a Hijri date, that's always effectively in... more 7/3/2014 9:05:59 AM
There are three reasons you're not seeing an infinite loop. Firstly, your test isn't waiting for the event to complete. You should change your test to: [Test] public async Task LoopTest() { ... await... more 7/3/2014 8:29:47 AM
Your use of AsEnumerable is forcing the filtering to be done locally. It's pulling in all the data, then filtering it in your app. That's clearly very inefficient. Now, it seems that part of your query can't be directly expressed in LINQ... more 7/3/2014 7:16:32 AM
Basically, type inference for generic type parameters works based on the arguments you pass to the method. So And() works, because you're passing in an isAdult. The compiler infers that TPred is PersonPredict as that's the type of isAdult... more 7/3/2014 5:58:56 AM
If your query is genuinely this: var lstUsers = (from users in lstProjects where users.ProjectId == pId select users.Users).ToList(); then that's equivalent to: List<ICollection<Users>>... more 7/2/2014 8:51:53 PM