Browsing 7239 questions and answers with Jon Skeet
A singleton which requires a parameter is a bit of a contradiction in terms. After all, you'd need to supply the parameter value on every call, and then consider what would happen if the value was different to an earlier one. I would... more 2/13/2014 11:05:06 PM
This, this is the problem: matches(".*@.*\..*") I suspect you want a regular expression with exactly this pattern: .*@.*\..* But you're writing it as a Java string literal, so you need to escape the backslash: matches(".*@.*\\..*")... more 2/13/2014 7:51:22 PM
You only want a single Z to represent "offset without a colon". Also note that you should ensure that your DateTimeFormatter is using English month/day names. For example: import java.util.*; import... more 2/13/2014 6:34:40 PM
In their example, they're creating an instance of Program, and calling a method on that instance: (new Program()).run(); This is more cleanly written as: Program program = new Program(); program.run(); From within those instance... more 2/13/2014 5:56:55 PM
It sounds like you've got a join, basically: var ratings = filterHotel.Split(',').Select(text => int.Parse(text)).Distinct(); var list = DAL.Get() .Join(ratings, hotel => hotel.Review, rating => rating, ... more 2/13/2014 4:57:07 PM
This returns time EST. Well, Date.toString() will, if you're in EST at the moment. It's not part of the data stored within the Date - that's just an instant in time, with no idea what time zone or calendar system it might have started... more 2/13/2014 4:19:23 PM
A statement lambda contains a block of statements... which means you need a statement terminator for each statement. Note that this is similar to anonymous methods from C# 2: AddDelegate ad = delegate(int a, int b) { return a + b;... more 2/13/2014 4:09:36 PM
I think you're looking for inheritdoc: /// <inheritdoc /> public override bool Equals(object obj) This is not a standard tag (so Intellisense may not support it, for exampple), but it's pretty commonly used - in particular,... more 2/13/2014 3:56:20 PM
However, what is the difference between the two methods if they both simply write two bytes to the outputstream? This sounds trite, but: one takes a char, the other takes a short. Those types aren't convertible to each other, and you... more 2/13/2014 3:04:37 PM
The N part is a prefix for a literal. You shouldn't need to to that. I would expect this to work: commandString = "select * from table where att=@param"; command.Parameters.Add("@param", SqlDbType.NVarChar).Value = "ğasd"; Note the... more 2/13/2014 2:42:00 PM