Results 1 to 40 of 59

Thread: [RESOLVED] multiple range checking algorithm vb6

Threaded View

  1. #31
    Fanatic Member
    Join Date
    Jan 2013
    Posts
    928

    Re: multiple range checking algorithm vb6

    Quote Originally Posted by Schmidt View Post
    It sure *is* faster than your Lookup-Routine (which I've written according to your "instructions").

    If you think you can do better than that, I'd surely want to see some code from *you*.
    What we have currently, regarding your approach is only a "paper-tiger", there's no Copy&Pastable
    demo - or even better - a zipped Demo-Project from you anywhere.

    I for my part would surely like to see, how you fill up that huge Lookup-Array of yours properly.
    To make it somewhat easier for you, I've now extracted the 88314 US-RangeRecords from the
    DataSet my larger Demo is using, and one can download it here:
    http://vbRichClient.com/Downloads/USRangesDetailed.zip

    It contains a normal CSV-File (USRangesDetailed.csv, with IPfrom,IPto per Line) -
    but also a Raw-CurrencyArray-File, called USRangesDetailed.bin, which one can load this way:
    Code:
    Private USRanges() As Currency
    
    Sub InitRangeArray(FileName As String)
      ReDim USRanges(0 To FileLen(FileName) \ 8 - 1)
      Dim FNr As Long: FNr = FreeFile
      Open FileName For Binary Access Read As FNr
        Get FNr, , USRanges
      Close FNr
    End Sub
    After the Init-Routine above was called, USRanges has an Ubound of 88314*2-1 and contains the sorted entries of the
    88314 US-RangeRecords as numeric values, the IPFrom-entries sitting at the even Indexes, the IPTo-entries at the odd IndexPositions.
    (mainly thought for those who want to try themselves at a Binary-Search-based algorithm against that Array).

    Would surely like to see some code from you, which got the Lookup-Arrays filled with that detailed set of US-Ranges
    (your choice, whether you read the data from the *.csv or the *.bin-file).


    I've mentioned that because my code is faster and takes less memory *despite* offering full country-resolution...

    If I reduce the Size of my DataSet to "US-Ranges only", then I'd expect results far better than 1 µsec per IPCheck-call.


    Nothing holds you back to reformat it to your liking, it's not that much code after all... <shrug>

    As for understanding it though, ...from how you post and interact with other developers (ignoring proof delivered by code) -
    I'd think you are still quite young and inexperienced (comparably), so don't expect "immediate results" just by looking at it...

    Olaf
    nope, but have better things to do... calm down, it is just an ideas exchanges!.

    EDIT: which have better things to do, is why I didn't bother in creating a zip with a vb project inside. Or timing it.

    I don't know about you, but I am 41yo, with commercial software published and commercializing it, supporting it, with sells and marketing ppl, oh and a graphics designer just hired a month ago....

    Anyway, programmer since 10yo..., doing video games in z80 and MSX BASIC since then...., spanish guy, so my english is not perfect.

    But all your asumptions, about young, and unexperienced was wrong..., maybe tomorrow as holiday, I can pick or reformat your code to make it more readable and then try to understand why you claim it be fast include it having LOOPS, and FOR/NEXT , to do the IPCHECK, because I see those loops, don't understand how your code can be faster.

    But sure, if country flag as return, and/ better, currency flag, sure it is better, more featureful. I am just not sure about faster.
    Last edited by flyguille; Aug 20th, 2017 at 04:32 PM.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width