Browsing 7239 questions and answers with Jon Skeet
What is the reason that char's out is getting printed as string for single char value where as integer if + operator is used? There's no + operator for char, so both operands are being promoted to int (values 65 and 66 respectively,... more 5/22/2015 12:11:15 PM
Ideally, I would suggest using TextReader as your abstraction level - it's rarely necessary to depend on StreamReader directly, as messing around with the underlying stream is generally a bad idea anyway. If you have code that takes a... more 5/22/2015 8:32:57 AM
Well currently you're converting the UTC timestamp to the system-local time - and presumably your server is in a different time zone to you. I would strongly advise you to log the UTC timestamp directly, in UTC. Whatever reads your logs... more 5/22/2015 6:14:06 AM
Looking at the documentation again, I think you want to use backticks or square brackets for the open type in the alias target, but not for the closed type or the alias itself: <unity... more 5/22/2015 6:02:23 AM
It looks like that culture doesn't use an AM designator: var culture = new CultureInfo("nl-BE"); Console.WriteLine("x{0}x", culture.DateTimeFormat.AMDesignator); That prints xx, suggesting that the AM designator is empty. You can... more 5/21/2015 6:20:25 PM
As kocko notes, the super statement must be the first statement in your constructor. However, if you really, really don't want to get as far as the superconstructor before validating (e.g. because it will blow up with a less-helpful... more 5/21/2015 1:08:46 PM
Since the reference sb is same It's not. You're using the sb variable each time, but each time you call stack.add(sb) it's adding "the current value of sb" which is different on each iteration due to this line: sb = new... more 5/21/2015 10:35:27 AM
You're running into a problem of integer arithmetic, basically - you're performing a division to get a scaling factor, but as an integer - so for something like 640x480, the scaling factors would be 1 and 0, because 640/480 is 1, and... more 5/21/2015 10:21:40 AM
The JIT "compiles" bytecode to native machine code which can then be run directly on further calls. In practice, many JVMs (e.g. Hotspot) will JIT-compile the same bytecode multiple times, adapting the optimization settings based on... more 5/21/2015 6:04:35 AM
No, there's no equivalent of method group conversions for constructors. (I can see it being handy, but it doesn't exist.) You just need to use the lambda expression syntax you've got in your first snippet. more 5/20/2015 6:25:16 PM