Browsing 7239 questions and answers with Jon Skeet
Assuming you just want to remove all non-BMP characters, i.e. anything with a Unicode code point of U+10000 and higher, you can use a regex to remove any UTF-16 surrogate code units from the string. For example: using System; using... more 1/19/2015 1:36:07 PM
You can't just write to a file within a jar file - it's not a file in the regular sense. While you could unpack the whole jar file, write the new content, then pack it up again, it would be better to redesign so that you don't need to... more 1/19/2015 11:23:27 AM
From comments: I am looking for the difference between the start of an event and the key press. It's important to understand that that's very different to trying to get the actual timestamp of a key press. This situation is exactly... more 1/19/2015 11:08:52 AM
As ever, the Java Language Specification is the appropriate resource to consult From JLS 15.21.1 ("Numerical Equality Operators == and !="): If the operands of an equality operator are both of numeric type, or one is of numeric type... more 1/19/2015 10:20:52 AM
The immediate problem is that the type of the Text property is string, not int - you have to set it to text, not a number. Fortunately, you can just call ToString on an int to get a string representation. However, I'd suggest there are... more 1/19/2015 6:55:45 AM
That's an instance initializer. It's a bit of code which is executed as part of constructing a new instance, before the constructor body is executed. It's odd to have it laid out in that way though, directly after a method. (It's... more 1/18/2015 6:22:07 PM
Just use parameterized SQL for the update command as well as the insert command. You should be doing that anyway in order to prevent SQL Injection attacks - the fact that it plays better with non-ASCII characters is a bonus. (IIRC, you... more 1/18/2015 7:57:12 AM
A method call using super just ignores any overrides in the current class. For example: class Parent { @Override public String toString() { return "Parent"; } } class Child extends Parent { @Override public String... more 1/17/2015 5:56:31 PM
Arrays.asList doesn't copy the array into a list - it creates a view onto the array. Any change you make via the list affects the array, and vice versa. That's why you can't add to (or remove from) the list returned by Arrays.asList -... more 1/17/2015 5:53:06 PM
Looking at the source code, it looks like the problem is that you haven't set a writer. It's not clear what you expect writeValue to do when you haven't set a writer, but you either need to change which method you call (e.g. calling... more 1/17/2015 11:48:34 AM