Browsing 7239 questions and answers with Jon Skeet
Well yes - if iso.FileExists(string.Format("{0}.jpeg", ld.Title)) returns false then you won't be assigning a value to savedUrl. What value do you want savedUrl to have in that case? This has nothing to do with the using statement - it's... more 10/30/2013 6:59:05 AM
The problem at the moment is that your method doesn't return anything if time.indexOf(":") doesn't return 1, 2 or -1. What do you want to do in that situation? You may want to throw an exception, for example. You should work out what you... more 10/30/2013 6:49:40 AM
Fundamentally, if you can get the value as an Instant to start with, it's as simple as: var instant = ...; // However you're receiving that var zone = DateTimeZoneProviders.Tzdb["America/Sao_Paulo"]; var inBrazil = instant.InZone(zone); more 10/29/2013 11:41:44 PM
You're trying to use System.Tuple<T1, T2>, which was only introduced in .NET 4. You're using .NET 3.5, so that structure isn't available. I suggest you create your own DateRange type which encapsulates a start and end DateTime, then... more 10/29/2013 9:28:08 PM
You can call getSource on the ActionEvent to find out the source of the event. That will be one of the buttons. more 10/29/2013 9:25:44 PM
You've got a break statement after each return statement. All those break statements are unreachable, precisely because you return before each of them. As per section 14.21 of the JLS: It is a compile-time error if a statement cannot... more 10/29/2013 9:11:06 PM
It's not the code you're compiling that's the problem - it's the code you're compiling against, in pi4j-core.jar, which appears to have been built with Java 7. I strongly suggest you upgrade the JDK, basically. Either that, or: Find a... more 10/29/2013 8:30:41 PM
WEEKDAY(F20) will be 6 - which is Friday. From the documentation: The day is given as an integer, ranging from 1 (Sunday) to 7 (Saturday), by default. So 6 is a Friday. It looks like you should be checking whether WEEKDAY(F20) is 1... more 10/29/2013 8:21:37 PM
It sounds like you're effectively grouping by the value in dictionary 1. I suspect you want something like: var sums = from p1 in dict1 where p1.Value != 0 join p2 in dict2 on p1.Key equals p2.Key ... more 10/29/2013 7:19:57 PM
A DateTime doesn't have a format. It's just a value. To parse a value such as "18-10-2013-20-27-54" you should use DateTime.ParseExact (or DateTime.TryParseExact, if it's somewhat-expected that the data may be invalid). So something... more 10/29/2013 6:11:38 PM