Browsing 7239 questions and answers with Jon Skeet
I can think of two options here: Regular expressions - fairly straightforward, but remember to quote the matches if you are accepting them as input. Sample code: using System; using System.Text.RegularExpressions; public class Test { ... more 8/31/2015 6:01:41 PM
Intuitively, the maximum speed of any particular projectile is unlikely to vary over its lifetime (even in the case where different instances of the same type can have different maximum speeds), therefore I would favour a final field for... more 8/31/2015 10:51:05 AM
The timestamp you've got is already in milliseconds. I don't know which converter you used, but if you put 1440823073243 into epochconverter.com it shows: Assuming that this timestamp is in milliseconds ... and comes up with a... more 8/30/2015 5:19:34 PM
Ideally, don't use this code at all - use a JSON parser which accepts an InputStream, instead of reading it line by line. If you need, specify UTF-8 as the encoding to the InputStreamReader, as you're currently just using the platform... more 8/30/2015 4:16:20 PM
No, there are no other options really. The command line arguments simply are passed as text. Some code, somewhere, has to parse them into integers. There are various third party libraries available to parse the command line, but your... more 8/30/2015 4:11:57 PM
If you only have at most 999 invoices per month, you probably don't need to worry two much about the inefficiencies involved in two invoices in quick succession, so each you need to generate an invoice: Work out the prefix to use (be... more 8/29/2015 2:01:19 PM
Expression.Variable is used to declare a local variable within a block. Expression.Parameter is used to declare a parameter for an incoming value. Now currently C# doesn't allow statement-bodied lambda expressions, but if it did,... more 8/29/2015 8:24:33 AM
It's talking about nested classes - here's an example: public class Test { public static void main(String[] args) { new Subclass(10).foo(); } static class Superclass { private int x; Superclass(int x)... more 8/28/2015 2:51:55 PM
You're passing in a byte array where the first byte has a top bit that is set - making it negative. From the constructor documentation: Translates a byte array containing the two's-complement binary representation of a BigInteger into... more 8/28/2015 2:35:50 PM
You're calling prepareStatement twice, setting the parameter on the first one but then calling executeQuery on the second. It's not clear where you're event declaring statement or resultSet, but you want: PreparedStatement preparedStmt =... more 8/28/2015 12:40:49 PM