Browsing 7239 questions and answers with Jon Skeet
If you're trying to deal a hand then it seems to me you need a collection - after all, a player holds multiple cards. I think you need to take a step back, rather than continuing with your current code. I'd do it something like... more 12/30/2013 8:54:41 AM
I suspect you were actually trying to use parameters - note that your pgp and team variables in C# aren't being used at all in your code. I suspect you want something like: using (OleDbConnection conn = new OleDbConnection()) { string... more 12/29/2013 6:15:07 PM
You should use an enum: [Flags] public enum WeekDays { Sunday = 1, Saturday = 2, Friday = 4, Thursday = 8, Wednesday = 16, Tuesday = 32, Monday = 64 } A simple explicit conversion will do the "remapping"... more 12/29/2013 5:45:53 PM
No, there's no need to do that. It won't make any difference to garbage collection. It's only important to set a variable to null (in terms of garbage collection) in one of these cases: It's a local variable in a long-running method It's... more 12/29/2013 8:51:17 AM
You're doing this in the UI thread, which means nothing in the UI has a chance to react to it until the loop has finished... only the last setBounds call will really have any visible effect. If you're trying to perform animation, you'll... more 12/29/2013 8:45:11 AM
You haven't really made it clear what you've done in Eclipse, but we can easily fix the "compiling and running it from the command line" problem. You're compiling and running it from the wrong directory. Compile it from the root, either... more 12/28/2013 11:03:02 PM
It's still alive, just not running. From the documentation: Tests if this thread is alive. A thread is alive if it has been started and has not yet died. A thread which is just sleeping or waiting hasn't died (it hasn't exited its... more 12/28/2013 10:54:20 PM
If you're looking for an exact match, you just need: bool found = lstRemovecol.Contains(row["Item code"].ToString()); No need for LINQ at all, or Any. If you're trying to find any of the items within a longer string (for example, if... more 12/28/2013 1:18:33 PM
Can I use using statement on a parameter object as in the following uncommon example code snippet (viz., multi-layer application)? You can, but it's generally odd to do so. Usually whatever is creating the StreamReader would be... more 12/28/2013 11:17:43 AM
You definitely don't want to use ObjectOutputStream - that will use binary serialization that your telnet server won't be expecting. It would be best to create an OutputStreamWriter: // Adjust the encoding to whatever you want, but you... more 12/28/2013 10:00:19 AM