Browsing 7239 questions and answers with Jon Skeet
There are three issues here. The first is that if you have a lot of text, you shouldn't be including that in the source code directly anyway. For small localizable pieces of text, you can use a resx/resources file - Visual Studio will... more 2/6/2016 8:15:00 AM
Well you can use: var result = (from t in DbSet where t.id < limit select t).Select(selector); ... but you can't just use the selector inside the query expression, as that's implicitly wrapping an extra... more 2/5/2016 11:41:33 AM
Basically it sounds like you need to change how you're handling the text from the RichTextBox. If you want to use \r as a line-break, use: string text = string.Join("\r", richtextbox.Lines); ClientSend(text); As mentioned in comments,... more 2/5/2016 11:39:06 AM
What if i want to only call one of those methods and that decision is to be made at runtime? Then you don't combine them together, basically. For example: // Names changed to be more conventional SampleDelegate s1 = someCondition ... more 2/5/2016 10:39:02 AM
Basically, you need to use generics. You're currently using raw types - so keyList.get(i) is an expression of type Object. It would also be cleaner to use an enhanced for loop (or Java 8 streams) - currently your for loop has an... more 2/5/2016 8:35:27 AM
Well, it's entirely fine to let the thread just complete normally. If the top-level call of a thread throws an exception, it may take down the process, depending on how the CLR is configured. It's usually better to have a top-level error... more 2/5/2016 7:25:40 AM
It sounds like you probably want something like: private static final List<String> VALID_CURRENCIES = Arrays.asList("RANDOM", "RANDOM2", "RANDOM3"); ... if (currencyChosen.equals(convertTo) &&... more 2/5/2016 6:54:12 AM
I suspect you haven't set the Format property appropriately on the picker. From the docs for DateTimePicker.CustomFormat: The Format property must be set to DateTimePickerFormat.Custom for this property to affect the formatting of the... more 2/4/2016 9:44:08 AM
You're not adding a \n - you're putting a line break back which readLine() effectively swallowed. For example, if your text file initially consists of 5 lines: line1 line2 line3 line4 line5 then reader.readLine() will return (in... more 2/4/2016 8:46:08 AM
Character literals use a single quote. So when you're dealing with char, that's 'x'. String literals use double quotes. So when you're dealing with string, that's "x". A char is a single UTF-16 code unit - in most cases "a single... more 2/4/2016 6:45:51 AM