Browsing 7239 questions and answers with Jon Skeet
Don't forget that it's in a loop. sum is 0 on the first iteration, but on the second iteration it contains the value of the last digit. So imagine you had a number of 195692. It would go through 7 iterations: num sum (before) r ... more 8/28/2015 11:56:35 AM
Any reason you wouldn't just load the whole file? string[] lines = File.ReadAllLines(@"C:\Users\Çağatay\Desktop\test.txt"); Likewise your first piece of code would be considerably simpler with: File.WriteAllLines( ... more 8/28/2015 11:44:02 AM
You're using the raw Map type here: Map suiteResults = suite.getResults(); You should specify the type arguments: Map<String, ISuiteResult> suiteResults = suite.getResults(); Or given that you're not using the variable other... more 8/28/2015 10:42:41 AM
No, it really is generating a tab - it's just that whatever you're using to view the file is deciding to handle tabs by aligning them to some boundary or other. If you make your postal value FB-6666x I suspect you'll then see a much larger... more 8/28/2015 7:47:26 AM
As w0lf suggested in comments, the simplest way of creating an array would just be: return new[] { GetMyData() }; While you could create an extension method, I personally wouldn't - and if you do, you absolutely should not call it... more 8/28/2015 7:19:51 AM
There is no type called SqlCe as far as I can see... for the DataColumn type, you should just be using System.Windows.Forms.DataGridViewColumn, ideally via a using directive for System.Windows.Forms. Note that DataGridViewColumn doesn't... more 8/28/2015 6:00:42 AM
Assuming letter_code is of type int, I'd probably cast to char and call ToString: textBox1.Text = ((char) letter_code).ToString(); more 8/27/2015 9:59:00 PM
It sounds like you don't want to use SelectMany at all - you only want one row per user. I suspect you want: var orderedList = users.OrderByDescending(user => user.UserDetails.Sum(d => d.Percentage)); more 8/27/2015 4:14:25 PM
Yes, it matters for local classes. It's worth noting that local classes are incredibly rare in real code. I can only remember ever using one once. However, for the sake of interest... From the JLS, section 6.3: The scope of a local... more 8/27/2015 4:09:37 PM
Not quite, but you can use explicit interface implementation: public class SomeScope : INameScope { void INameScope.Register(string name, object scopedElement) { RegisterName(name, scopedElement); } public void... more 8/27/2015 12:01:46 PM