Browsing 7239 questions and answers with Jon Skeet
The problem appears to be caused by your use of LoadOptions.PreserveWhitespace. This seems to trump XmlWriterSettings.Indent - you've basically said, "I care about this whitespace"... "Oh, now I don't." If you remove that option, just... more 12/18/2014 2:09:31 PM
Just parse it as a long first, and cast the result: int value = (int) Long.parseLong("11111111000000001111111100000000", 2); That handles the fact that int runs out of space, because there's plenty of room in a long. After casting, the... more 12/18/2014 1:59:39 PM
You've got two different C2 classes - an ArrayList<a.C2> isn't the same as an ArrayList<b.C2>. They're incompatible to avoid this sort of thing: ArrayList<b.C2> listB = new ArrayList<b.C2>(); ArrayList<a.C2>... more 12/18/2014 11:35:08 AM
You're calling System.out.println(test), which is a call to PrintStream.println(Object). That will call toString() on the reference you pass in, via String.valueOf: Prints an Object and then terminate the line. This method calls at... more 12/18/2014 11:20:35 AM
I suspect it's because that's what it looks like in IL. The CLI has two different kinds of arrays: vectors which are "rank 1, 0 lower bound" arrays, and arrays which are "any rank, any lower bound" arrays. (Yes, the naming is very... more 12/18/2014 11:02:55 AM
Could it get stuck forever in the while that checks for a new line from socket? Yes, if there's no more data. But I suspect that's not the problem. I suspect the problem is this: Looper.loop(); As far as I can see, you don't need... more 12/18/2014 9:11:32 AM
If you're absolutely sure of the user's culture - and that they'll actually use that - you could use: // I assume that Culture is a valid reference to a CultureInfo... DateTime date = DateTime.Parse(date, Culture); However, I'd strongly... more 12/18/2014 7:16:23 AM
The smiley is just how the console displays U+0001 (start of heading) - and that's the character that apparently is read as input from the console when you type Ctrl-A... a bit like the way that if you type Ctrl-G you get U+0007... more 12/18/2014 6:52:54 AM
Your two object creation expressions are equivalent. If you don't specify the (), it's supplied for you by default. So: var foo = new Foo { X = y }; is equivalent to: var foo = new Foo() { X = y }; From the C# 5 specification,... more 12/17/2014 6:42:43 PM
To determine a "calendrical" amount of time between two events, you want Period as you've already discovered. However, that only deals with local dates and times. To determine a "calendar-neutral" amount of time between two events, you... more 12/17/2014 5:18:00 PM