Search Results

Search found 2 results on 1 pages for 'g36'.

Page 1/1 | 1 

  • Read text file into listbox collections

    - by Arcadian
    Hi, i'm new to C#. I need my program to show different parts of the data contained in a txt file into different listboxs (which are on different tabs of a form) so that the user can see the particular block of data they are interested in. the data contained in the txt file looks like this: G30:39:03:31 JG06 G32:56:36:10 JG04 G31:54:69:52 JG04 G36:32:53:11 JG05 G33:50:05:11 JG06 G39:28:81:21 JG01 G39:22:74:11 JG06 G39:51:44:21 JG03 G39:51:52:22 JG01 G39:51:73:21 JG01 G35:76:24:20 JG06 G35:76:55:11 JG01 G36:31:96:11 JG02 G36:31:96:23 JG02 G36:31:96:41 JG03 though much more of it :) The separate listboxes will contain only the lines who's first integer pair matches that listbox's name. For example, all the lines that start "G32" will be added to the G32 listbox. I think the code would start something like: private void ReadToBox() { FileInfo file = new FileInfo("Jumpgate List.JG"); StreamReader objRead = file.OpenText(); while (!objRead.EndOfStream) but i'm not sure where to start in terms of getting it sorted yet. Any help? There's some rep in it for you :D

    Read the article

  • performance of large number calculations in python (python 2.7.3 and .net 4.0)

    - by g36
    There is a lot of general questions about python performance in comparison to other languages. I've got more specific example: There are two simple functions wrote in python an c#, both checking if int number is prime. python: import time def is_prime(n): num =n/2 while num >1: if n % num ==0: return 0 num-=1 return 1 start = time.clock() probably_prime = is_prime(2147483629) elapsed = (time.clock() - start) print 'time : '+str(elapsed) and C#: using System.Diagnostics; public static bool IsPrime(int n) { int num = n/2; while(num >1) { if(n%num ==0) { return false; } num-=1; } return true; } Stopwatch sw = new Stopwatch(); sw.Start(); bool result = Functions.IsPrime(2147483629); sw.Stop(); Console.WriteLine("time: {0}", sw.Elapsed); And times ( which are surprise for me as a begginer in python:)): Python: 121s; c#: 6s Could You explain where does this big diffrence come from ?

    Read the article

1