Browsing 7239 questions and answers with Jon Skeet
I suspect you're just running into the fact that a period at the start of a line is used to terminate a mail. From RFC 2821 section 4.5.2: 4.5.2 Transparency Without some provision for data transparency, the character sequence ... more 4/9/2014 10:17:34 AM
I strongly suspect that after casting to byte, your indexes are being converted back to int anyway for use in the array indexing operation. That will be cheap, but may not be entirely free. So get rid of the casts, unless you were using... more 4/9/2014 9:38:48 AM
It's not clear why you keep converting to dictionaries all the time. The order of entries Dictionary<,> is not guaranteed. It looks like you just want: var topValues = differentKeys.Values ... more 4/9/2014 9:00:49 AM
Firstly, a few points on your benchmarking: I would suggest adding a call to each method before the timing starts, so that you're not measuring JIT compilation time I would suggest adding a call to GC.Collect() after each test, so that... more 4/9/2014 7:55:33 AM
The simplest approach is to fetch just the data you want in the part that's translated into SQL, and then do the rest locally: public List<Class_CourseStartdate> GetClosestStartDate(DateTime coeStartdate) { return... more 4/9/2014 7:28:49 AM
Unless it's a value type, there'll be no boxing going on - but in the code sample you've used, there's no real use of dynamic typing anyway. Your code thus far is equivalent to: object key = "BankProject.Payment"; Type myType =... more 4/9/2014 7:20:00 AM
Edited to perform rounding... So: long tickOfSecond = original.Ticks % TimeSpan.TicksPerSecond; long ticksToAdd = tickOfSecond < TimeSpan.TicksPerSecond / 2 ? -tickOfSecond : 10000000 - tickOfSecond DateTime truncated =... more 4/8/2014 9:48:51 PM
Depending on what you're using: Standard Java libraries, before Java 8 Calendar calendar = new GregorianCalendar(); // Just to avoid corner cases calendar.setTimeZone(TimeZone.getTimeZone("Etc/UTC")); calendar.set(year, month - 1,... more 4/8/2014 9:38:50 PM
The problem is that your application is trying to use the console in a relatively advanced way - setting the cursor position. In this case, you don't really have a console, you just have piped output... so there's no console handle, and... more 4/8/2014 9:35:48 PM
Nothing is going wrong. You are successfully parsing an XML document, which you've got a reference to in the doc variable. All that's wrong is your expectation that Document.toString() will give you back something meaningful. It looks... more 4/8/2014 8:41:26 PM