Browsing 7239 questions and answers with Jon Skeet
EDIT: There are multiple things wrong with your code: You're not specifying the user_id parameter in the command, although it's in the SQL You're trying to use the InsertCommand of the adapter even though you haven't specified any... more 11/12/2013 6:58:24 AM
The problem is that the count decreases as you dequeue items. So by the time i is 4, the count is also 4, so the loop stops. If you want to keep dequeuing until the queue is empty, you could use: while (_actionQueue.Count > 0) { ... more 11/11/2013 10:57:59 PM
You can make your enums implement an interface: public interface Coded { int getCode(); } Then: public enum Answers implements Coded { ... } And: public class Test<T extends Enum & Coded> { public void tester(T... more 11/11/2013 6:16:15 PM
so will it reload again for further calls on some methods on that class? No. If type initialization fails for a particular type, that type is effectively useless throught the lifecycle of the AppDomain. Any further attempt to use the... more 11/11/2013 4:31:13 PM
You're using Element("author") and Element("name") as if they're not in a namespace. The namespace will have been defaulted to the same namespace as entry, so you want: var ns = "http://www.w3.org/2005/Atom"; // Just use an implicit... more 11/11/2013 10:25:00 AM
The simplest approach is probably to use something like: public int getHoursInDay(LocalDate date, DateTimeZone zone) { DateTime start = date.toDateTimeAtStartOfDay(zone); DateTime end =... more 11/11/2013 9:26:09 AM
From the documentation: When user authentication is enabled (which it is not by default), the user requesting a connection must provide a valid name and password, which Derby verifies against the repository of users defined for the... more 11/11/2013 7:17:57 AM
According to the documentation, the second argument of strftime is meant to be a timestring, which need to be in one of the following formats: YYYY-MM-DD YYYY-MM-DD HH:MM YYYY-MM-DD HH:MM:SS YYYY-MM-DD HH:MM:SS.SSS ... more 11/11/2013 7:12:28 AM
Don't use string.Format to put parameters into your SQL to start with. Instead, use parameterized SQL, and specify the values for those parameters. This will avoid SQL Injection Attacks as well as helping avoid unnecessary and problematic... more 11/11/2013 6:57:25 AM
When you call decimal.TryParse or decimal.Parse, you can specify a culture (and therefore avoid just picking up the system settings). You could try each culture you're interested in one at a time until you find one where the value parses... more 11/11/2013 6:53:20 AM