Browsing 7239 questions and answers with Jon Skeet
I would almost certainly simplify that, in a number of ways: EditText editText = (EditText) view.findViewById(R.id.fooEditText); String resourceName = someExpression ? R.string.true_expression_text :... more 10/4/2013 2:53:22 PM
How can I handle it from C# front!? You can use the unchecked operator for the constant assignment: uint state = unchecked((uint) -1); From the C# spec section 7.6.12: The checked and unchecked operators are used to control the... more 10/4/2013 2:42:50 PM
The problem here is the "string MainArgs;" line. I need it to call Menu() with "null" to start over. No, you really don't. You don't need takenDump either. You can just change the call to: TextAdventure1.AdventureTime.Menu("null",... more 10/4/2013 2:36:31 PM
I think calling it "hiding" is misleading here, to be honest. Both methods are definitely created, but if you call: Concat(5); then for that invocation both methods are applicable (in the terminology of the C# spec section 7.5.3.1) but... more 10/4/2013 9:07:00 AM
That's not a global variable - it's an instance variable. Just use this: String s = "Local"; lblB.setText(this.s); (See JLS section 15.8.3 for the meaning of this.) For static variables (which are what people normally mean when they... more 10/4/2013 6:24:38 AM
Well, you could use dynamic typing. That will basically defer overload resolution until execution time: foreach (dynamic rawDataItem in rawData) { Debug.Print(GetName(rawDataItem)); } Note that there's potentially a performance cost... more 10/4/2013 6:05:09 AM
what i don't understand is exactly when is this code executed Whenever an instance of MainClass is executed. Note that each instance of MainClass which is created will in turn create a new instance of the anonymous class. Because... more 10/4/2013 5:42:19 AM
it skips over [...] Presumably that's because there's no data to read, so myReader.Read() just returns false. it doesnt write the values i told it to. You don't actually tell it to write anything. You create a SqlCommand to... more 10/3/2013 7:32:31 PM
Given your tags, it sounds like you may be building a Windows Store app - in which case you need to use HttpClient instead of WebClient. more 10/3/2013 4:58:48 PM
Sure: Open a FileInputStream wrapped in an InputStreamReader with the Windows-1252 for the input Open a FileOutputStream wrapped in an OutputStreamWriter with the UTF-8 encoding for the output Create a buffer char array (e.g.... more 10/3/2013 4:51:00 PM