Browsing 7239 questions and answers with Jon Skeet
because I didn't add an item with key "2" at this.dictionary. Yes you did. You did it with this call: tmp.AddE(tmp, "String2","2"); That adds an entry with key "2" and value "String2" to the dictionary referred to by tmp... which... more 7/3/2016 4:28:34 PM
You've already specified the SQL when you prepared the statement: pstmt = con.prepareStatement(squery); You shouldn't then use Statement.executeUpdate(String) - instead, just use the parameterless executeUpdate() method: int num =... more 7/3/2016 2:13:44 PM
The compiler is already telling you what is wrong - but to quote section 7.3.2 of the C# 5 specification: User-defined operator declarations always require at least one of the parameters to be of the class or struct type that contains... more 7/2/2016 9:49:01 AM
I suspect you have a space or something at the start of the text selected by your RichTextBox. At that point, it makes total sense. Look at your regular expression: (duplicate of )*([0-9]:+)* That will match the empty string. So for... more 7/2/2016 7:14:28 AM
The standard solution to this is to use the template method pattern: public abstract class Base { // Note: this is *not* virtual. public void SomeMethod() { // Do some work here SomeMethodImpl(); // Do... more 7/1/2016 8:28:34 AM
Note: this answer assumes that you're interested in "natural" weeks, which don't really care about the year. For example, December 31st 2015 was a Thursday, and January 1st 2016 was a Friday - to my mind (and using the algorithm in this... more 7/1/2016 8:14:27 AM
r2 is fine due to section 15.13.2 of the JLS, which includes: A method reference expression is congruent with a function type if both of the following are true: The function type identifies a single compile-time declaration... more 6/30/2016 9:15:32 AM
It's indexed because each value is an index into a colour table, which may well be RGB or RGBA with considerably more depth. For example, you could have a palette of 32-bit entries (8 bits for each of red, green, blue and alpha), but the... more 6/29/2016 7:08:34 PM
Simply put, they're different types. Imagine you had two classes like this: public class A1 { public int Value { get; set; } } public class A2 { public int Value { get; set; } } They're different classes despite looking... more 6/29/2016 5:32:39 AM
I believe this is the problem: using (NetworkStream stream = client.GetStream()) That is automatically closing the stream at the end of the block, which in turn (I believe) closes the socket. The documentation is frankly unclear on this... more 6/28/2016 4:09:39 PM