Browsing 7239 questions and answers with Jon Skeet
You need to read the documentation for pattern characters very carefully: You want yyyy rather than YYYY, as you want regular calendar years rather than year-of-era. (Not likely to be significant in Joda Time, but if you port the code to... more 2/5/2015 9:42:42 AM
Basically, don't use DataInputStream if you're trying to read text. DataInputStream is meant for streams of data written by DataOutputStream or something similar. Read the documentation for readDouble to see exactly what it's... more 2/5/2015 7:14:12 AM
It's got nothing to do with Ant - this is just the documented behaviour of Properties.store: Then every entry in this Properties table is written out, one per line. For each entry the key string is written, then an ASCII =, then the... more 2/4/2015 10:37:38 PM
The Element method only returns a single element. You want: root.Elements("Child1").Elements("GrandChild1").Remove(); That uses: The normal XContainer.Elements method The Extensions.Elements extension method (on IEnumerable<T>... more 2/4/2015 9:12:05 PM
You can't, basically - you'd have to invoke the relevant methods with reflection, which is ugly. Of course you can do this with dynamic typing, which hides the reflection from you: public T DoStuff<T>(int x, int y) { dynamic d =... more 2/4/2015 8:51:00 PM
In C# 6, you'd use: List<string> list = new List<string> { nameof(AccountOwner.AccountOwnerName), nameof(AccountOwner.AccountOwnerNumber) }; Before that, you could certainly break the expression tree apart - the... more 2/4/2015 7:56:55 PM
So, if I modify the value of a String inside a method, it should be modified when the method call is terminated (since String is an object in C#). But this isn't true, in fact if I write: You're not modifying the String object. You're... more 2/4/2015 6:44:03 PM
I'm assuming that by float you mean a 32-bit IEEE-754 binary floating point value, by double you mean a 64-bit IEEE-754 binary floating point value, and by int you mean a 32-bit integer. Why does this happen? The range of float far... more 2/4/2015 4:01:57 PM
I believe that the problem is that NSDate itself (i.e. the value you're logging at the end) doesn't have a time zone - it's just a moment in time. You're specifying the time zone *when formatting the value using stringFromDate*, and you're... more 2/4/2015 3:45:43 PM
The problem is this line: long result = i * 184528125; The right hand side is evaluated in 32-bit integer arithmetic, because both operands are int. There's then an implicit conversion to long. To fix it, just make the RHS a long... more 2/4/2015 3:28:28 PM