Browsing 7239 questions and answers with Jon Skeet
If you know the offset, you can use DateTimeZone.forOffsetMillis to create a fixed-offset time zone. That won't necessarily be the real time zone, but the offset alone isn't enough information to tell you the real time zone. more 11/25/2014 12:58:18 PM
You can configure the transformer not to output the XML declaration, before you call transform: serializer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "yes"); more 11/25/2014 11:45:35 AM
You don't need to mock User - you can use the real User class. You only need to mock (or fake) IUserManager. Your mock/fake IUserManager can use User.CreateUser to create the User objects to be returned to your controller. Unless the User... more 11/25/2014 10:09:15 AM
int x might not have an assignment. That's simply not true. In your case, x is a parameter - it's "definitely assigned" from the start of the method, in specification terminology. When someone calls the method, they have to provide a... more 11/25/2014 9:05:48 AM
Just don't do this: return UTF8Encoding.UTF8.GetString(protectedPasswordByte, 0, protectedPasswordByte.Length); Firstly, I'd strongly advise using Encoding.UTF8 instead of UTF8Encoding.UTF8, for clarity. That won't fix the problem, but... more 11/25/2014 7:25:20 AM
There's no implicit conversion available from the literal 0 to T. For example, T could be string, or TextField... You may well want to limit your vector to struct types: public class Vector3D<T> where T : struct ... but even so,... more 11/25/2014 7:15:38 AM
I would strongly suggest that you revisit your design entirely: Avoid multiple "parallel" collections like this. Instead, have a single collection of type Player, where Player is a new class consisting of a player number, a last name,... more 11/25/2014 6:54:45 AM
You can convert from a LocalDate - how you get that is up to you. For example: // Avoid using java.util.Date unless you really have to. // Stick to java.time.* if possible Date date = ...; Instant instant =... more 11/25/2014 6:49:26 AM
You don't want SelectMany for the image property - that's going to give a sequence of bytes. For each list of containers, you want to transform that to a list of byte arrays, i.e. innerList => innerList.Select(c =>... more 11/24/2014 8:10:42 PM
Arrays.asList doesn't return a java.util.ArrayList. It does return an instance of a class called ArrayList, coincidentally - but that's not java.util.ArrayList. Unless you need this to really be an... more 11/24/2014 7:52:17 PM