Browsing 7239 questions and answers with Jon Skeet
I don't know why. You didn't provide a stack trace, but I assume it's on the call to this.notify(). From the documentation of Object.notify(): Throws: IllegalMonitorStateException - if the current thread is not the owner of... more 6/6/2014 9:46:32 AM
Currently you're calling plus, but ignoring the result. I suspect you want something like: Label_plus.Text = plus(tal1, tal2).ToString(); That sets the content of the label which will then be rendered within the response. Not sure if... more 6/6/2014 9:08:05 AM
Yes, TimeZoneInfo.Local is somewhat broken on Mono. I've seen three different failure modes here: Returning a time zone which acts correctly, but has an ID of "Local" Returning a null reference Throwing an exception I don't have a good... more 6/6/2014 6:09:35 AM
The second line should actually be: e l 8 (note that the second value is a lower-case L, not a 1) which probably doesn't violate your expections. Although your variable is confusingly called third despite it being the fifth character in... more 6/5/2014 6:11:42 PM
The reason that it's currently picking the second method is that a conversion from a type to itself (second method, T=List<int>, conversion from List<int> to List<int>) will always be "better" than a conversion to the... more 6/5/2014 5:52:42 PM
You're not including the Simple JSON jar file in your classpath when running. You want: // Unix java -cp .:json-simple-1.1.1.jar MyProgram // Windows java -cp .;json-simple-1.1.1.jar MyProgram (The : or ; is the path separator for the... more 6/5/2014 4:42:36 PM
Unfortunately Java generics use type erasure, meaning that at execution time, any particular PacketHandler<T> is just PacketHandler as far as the VM is concerned. You may want to change your code to: public interface PacketHandler... more 6/5/2014 4:32:00 PM
Yes, the code you've shown already handles a negative end: if (end < 0) { end = source.Length + end; } So all you've got to do is the same thing for start: if (start < 0) { start = source.Length + start; } (Or use +=,... more 6/5/2014 4:09:11 PM
You should use an OutputStream to write and an InputStream to read. Those are for binary data - anything with a suffix of Writer or Reader is for text data. You may find DataOutputStream and DataInputStream useful - they basically add... more 6/5/2014 1:07:06 PM
The simplest approach would just be to create a method to do that: private Button createButton(String text) { Button ret = new Button(parentComposite, SWT.CHECK); ret.setText(text); ret.setSelection(true); ... more 6/5/2014 10:19:42 AM