Browsing 7239 questions and answers with Jon Skeet
You shouldn't think about "changing the time zone" of a LocalDateTime - a LocalDateTime doesn't have a time zone. Instead, you should build a ZonedDateTime from a LocalDateTime and a time zone (ZoneId). First remove the formatter.withZone... more 6/16/2015 3:58:21 PM
Yes, in your original for loop you're accessing the value by index - although you should note that you're skipping the check for element c (because by then the value that was at index 2 is now at index 1). There's no way this would create... more 6/16/2015 2:10:25 PM
When you use FileReader and FileWriter, they will use the default encoding for your platform. That's almost always a bad idea. In your case, it seems that that encoding doesn't support U+0092, which is fairly reasonable given that it's a... more 6/16/2015 6:13:43 AM
Your compilation error is because String.charAt() returns a char, not a String. They're different types - and you need to be very clear about the difference between them. You could just change the variable to a char variable, renaming it... more 6/16/2015 5:59:45 AM
You just need to put the jar file you want earlier in the build path in Eclipse, or earlier in the classpath in general. You might want to have a look for a version of CDH / Hive (I haven't used them) which doesn't come bundled with a copy... more 6/16/2015 5:53:06 AM
It's not clear to me what mailMessage.writeTo(baos, Array[String]("X-Sender")) actually does, but it feels like your initial code is being very wasteful in converting everything to a string and back, and even your second code is doing a... more 6/15/2015 9:11:33 PM
Both constructors are applicable, because null is convertible to both Object and double[] - so the compiler needs to use overload resolution to determine which constructor to call. JLS 15.9.3 uses JLS 15.12.2 to determine the "most... more 6/15/2015 4:54:28 PM
No, I don't believe there's any way of doing that in VB. Conditional operators (such as If(x, y, z)) are designed to evaluate one expression or the other based on a condition. In other words, it's the result that's conditional, not the use... more 6/15/2015 4:43:19 PM
You should be specifying parameters for your values: commd.CommandText = "insert into funds_hidden values(?, ?)"; commd.Parameters.Add("code", OleDbType.VarChar).Value = fund_code; commd.Parameters.Add("name", OleDbType.VarChar).Value =... more 6/15/2015 4:09:54 PM
Assuming you want the count of the distinct "mode" attribute values within the nodes with the same ID/name, you just need to project from each element in the group to the mode, then take the distinct sequence of those modes, then count... more 6/15/2015 9:39:06 AM