Browsing 7239 questions and answers with Jon Skeet
I feel like I'm missing some obvious and there should be an easier method, is there a simpler way to find a period between two dates whilst excluding certain dates? Well, it's relatively easy to count the number of bank holidays... more 11/19/2013 4:47:04 AM
If you're actually trying to replace U+0096 with U+002D, you can use: text = text.Replace("\u0096", "\u002d"); Note that U+0096 is "start of guarded area" though. If you actually mean "the value that is encoded in Windows 1252 as 96"... more 11/18/2013 10:44:56 PM
I would store the actual date/time value. Then for querying, to search for "anything on Wednesday" you'd go from Wednesday 0400 (inclusive) to Thursday 0400 (exclusive). In terms of display, you'd probably be best taking the date, and... more 11/18/2013 4:54:14 PM
Is there anyway to see what LINQ does in the background? Well, you could look at my Edulinq implementation and the accompanying blog posts to get an idea of what's going on in LINQ to Objects. Obviously it's not the real... more 11/18/2013 4:12:52 PM
How can I make the compiler force the invocation with named parameters? You can't, basically. It's just not part of the language. What you can do is make the constructors private, and instead expose static factory methods, which... more 11/18/2013 3:26:01 PM
It sounds like you want to constrain your Result type parameter to extend Notification: private HashMap<RequestType, LinkedList<IRequestListener<? extends Notification>>> requestListenerMap = new HashMap<>();... more 11/18/2013 2:46:13 PM
Firstly - and more importantly - for currency values, you should be using decimal rather than double. Decimal floating point numbers are more appropriate for monetary values, which are exactly represented in decimal - whereas binary... more 11/18/2013 2:38:29 PM
You need to decorate your enum with FlagsAttribute. <Flags> Public Enum HotkeyModifiers As Short SHIFT = 1 CONTROL = 2 ALT = 4 NONE = 0 End Enum That affects the behaviour of both ToString and parsing. more 11/18/2013 1:47:27 PM
It sounds like you're after something as simple as: Console.WriteLine("{0} + {1} = {2}", x, y, x + y); if (x + y > 10) { Console.WriteLine("TRust too large"); } An if statement is basically just a condition, with some code to... more 11/18/2013 12:39:04 PM
I have a table with column name Date_Time containing date and time in 24 hrs. format No, you have a table with a column type of DateTime. The values don't inherently have any format - they just happen to be displayed one way in your... more 11/18/2013 5:13:43 AM