Search results

  1. T

    Prime numbers in array

    When checking for prime you only need to check to the sqrt of the possible prime. This will speed up the testing even more. The time you save increases rapidly when testing large numbers. For count = 2 to Sqrt(currentNumber) ... Next Take for example the number 1000000. Testing up to...
  2. T

    Processor emulator

    Is it a bad idea to write it in .NET? What other language would you recommend then, C?
  3. T

    Processor emulator

    Im trying to write a emulator for a processor called RCx8. Do anyone know of a good tutorial on processor emulating or emulators in general? What I need is a tutorial that includes the logical steps in creating an emulator. Im also looking for a tutorial for creating a virtual memory for my...
  4. T

    Using And in class

    Is there any way that I can create a public function in my class that is called And. I get an understandable error saying that And is a reserved word. Is there any way around this problem? In the System.Collections.BitArray class they use And as a function name. How do they do that?
  5. T

    VB "Left"

    I might be me, but I cant use substring to replace chars within strings like I can with mid. I have tried to use Insert but it doesnt seem to replace, it only inserts new chars.
  6. T

    Reading large textfiles fast

    I found the following code but the buffer doesnt return anything. Dim myStreamReader As StreamReader = New StreamReader( _ New FileStream("C:\somefile.txt", FileMode.Open), _ System.Text.Encoding.Unicode, False, 4096) Dim cBuffer() As Char ReDim cBuffer(4096) Do While...
  7. T

    Wildcards and/or Regular Expressions

    By using a parser you can build a regular expression from the template. The template symbol * equals \w* in regex and ? equals \w. Then try this: Dim Template As String Dim Pattern As String Dim SearchString As String Dim FoundMatch As Boolean Dim i As Integer Dim r As Regex Template =...
  8. T

    Regex problem

    Im currently working on a modul for a crypto tool and Im having some problems. The modul is supposed to be able to match word by the use of a mask consisting of letters. For exemple should the mask abb match the words t ree and s upp ose. So far I have written a parser that generates a regex...
  9. T

    Reading large textfiles fast

    I want to read textfiles as large as 100000 lines and I want it go as fast as possible. I have tried using StreamReader.ReadLine and that works fine for textfiles with 20000 lines which takes approx. 3-4 sec. When I use the same code on a textfile with 40000 lines it doesnt take 6-8 sec but...
  10. T

    VB "Left"

    Imports You need to import the namespace that includes the Left function. Include this first in your code, before any declaration. Imports Txt = Microsoft.VisualBasic.Strings You can then use the following syntax to access the Left function. Txt.Left("testing,2) You can you the Object...
Back
Top