Browsing 7239 questions and answers with Jon Skeet
(This isn't an answer which gives you a complete solution by any means, but hopefully it's a step in the right direction.) Good luck. I've worked on an ActiveSync implementation, and recurrent events are fundamentally painful. You'll need... more 10/8/2014 3:30:10 PM
This is the problem: cal.set(Calendar.MONTH, date.getMonth()); XMLGregorianCalendar uses a month range of 1-12. java.util.Calendar uses a month range of 0-11. You want: cal.set(Calendar.MONTH, date.getMonth() - 1); Also note that you... more 10/8/2014 11:56:16 AM
Basically the original java.util.Date designers copied a lot from C. What you're seeing is the result of that - see the tm struct. So you should probably ask why that was designed to use the year 1900. I suspect the fundamental answer is... more 10/8/2014 11:40:28 AM
From the documentation for System.Single: All floating-point numbers have a limited number of significant digits, which also determines how accurately a floating-point value approximates a real number. A Single value has up to 7... more 10/8/2014 11:33:38 AM
No, it's matching correctly but you only have a single group (the whole string). So Groups[1] is invalid - if you ask for Groups[0] it's fine: using System; using System.Text.RegularExpressions; class Program { static void... more 10/8/2014 11:27:15 AM
Your synchronized method is effectively: private void callMe() { synchronized(this) { System.out.println("Started"); for (int i = 1; i <= 5; i++) { System.out.println(name+" = "+i); } ... more 10/8/2014 11:00:59 AM
I suspect the problem is that NUnit is running your tests in a different AppDomain, but without using ExecuteAssembly. From the documentation for Assembly.GetEntryAssembly: Gets the process executable in the default application domain.... more 10/8/2014 10:34:04 AM
Firstly, fix this line and similar ones: total = Convert.ToDecimal(hours * 7.50); In this particular case it's unlikely to be a problem, but you should try to avoid mixing double and decimal. You can just uese: decimal total = hours *... more 10/8/2014 10:12:44 AM
If you only have an offset, then no, you can't. -5 could be Central Daylight Time or Eastern Standard Time, for example. Likewise an offset of -7 could be Pacific Daylight Time or Mountain Standard Time. If you have an offset and a... more 10/7/2014 8:55:39 PM
As of Java 7, reading the whole of a file really easy - just use Files.readAllBytes(path). For example: Path path = Paths.get("my_file.txt"); byte[] data = Files.readAllBytes(path); If you need to do this more manually, you should use a... more 10/7/2014 8:53:31 PM