Browsing 7239 questions and answers with Jon Skeet
Can you do exact same thing without using that method? Actually Nope. You absolutely can. Here's a really inefficient way of doing it - which doesn't consider overflow, invalid input or negative numbers, but demonstrates the general... more 12/30/2014 8:26:24 PM
This is the problem: DTSTART: starttime.ToUniversalTime().ToString("yyyyMMdd\\THHmmss\\Z") DTEND: Endtime.ToUniversalTime().ToString("yyyyMMdd\\THHmmss\\Z") You're explicitly specifying the start and end times as UTC, and you're never... more 12/30/2014 8:12:57 PM
Those aren't query parameters. They're the fragment of the URI - and that isn't sent to the server at all. It can only be used client-side. From RFC 3986: A fragment identifier component is indicated by the presence of a number sign... more 12/30/2014 7:50:58 PM
So, let's look at the call: ((A)this).met((A)this); That's equivalent to: A target = this; A argument = this; target.met(argument); So, for the last line, the compiler looks up the signature based on the compile-time types involved -... more 12/30/2014 7:17:08 PM
You're not constructing the dates you think you are. These lines: var later = new DateTime(2015-01-01); var now = new DateTime(2014-12-31); are equivalent to: var later = new DateTime(2013); var now = new DateTime(1972); After all,... more 12/30/2014 6:45:56 PM
If you're looking for the ISO-8601 week-of-week-year, you could use my Noda Time project: var date = new LocalDate(2014, 12, 30); var week = date.WeekOfWeekYear; // 1 var weekYear = date.WeekYear; // 2015 You can get a LocalDate from a... more 12/30/2014 5:54:42 PM
On the overload constructor I have a message that shows the count of the list values every time a new one is added and guess value is always 1 and I just don't understand why. That's because each time you create a new instance of mng... more 12/30/2014 4:43:55 PM
So technically, string s=@""Hello""; should print "Hello" No, that would just be invalid. The compiler should - and does - obey the rules of the language specification. Within a verbatim string literal, double-quotes must be doubled... more 12/30/2014 1:02:41 PM
Half of the point of anonymous functions are that they can capture the context in which they're specified. It's extremely convenient to be able to do so - that's the "why" part. The way the compiler does this is to create a new class in... more 12/30/2014 8:19:15 AM
The only difference between foo(String... strings) and foo(String[] strings) is for the calling code. Consider this call: foo("a", "b"); That's valid with the first declaration of foo, and the compiler will emit code to create an... more 12/29/2014 12:51:17 PM