Results 1 to 40 of 186

Thread: VB6: Best way to find all permutations of a given string in a file - Contest

Threaded View

  1. #1

    Thread Starter
    Banned randem's Avatar
    Join Date
    Oct 2002
    Location
    Maui, Hawaii
    Posts
    11,385

    VB6: Best way to find all permutations of a given string in a file - Contest

    Aloha,

    This is a Spin-off from another thread where this all began. What we want to do here is take the file given here and search it for every permutation of the string asdf (This file will be updated occasionally). For this test all 8000 known entries in the 5mb file are in lower case. This does not mean that there are not more for the file was created by a random method and as you know random means random so it is possible that there are more. The file format is true binary. This means that all characters are in the file from 0-255. The representation of the permutations are in ASCII format. NO UNICODE or any other format is represented in the file.

    I have also included in the zip file a file that contains the index for every permutation that is known in the file and what the permutation is. This file is supplied so that you can verify your work. Remember there may be more permutation in the file than the known ones... and the unknown one may span the 64k byte boundary.

    Once all the entries are in I will create a different type of file that will contain some variations of the permutations and test the entries on that file just to keep everything honest. I will see about getting a prize of some sort for the winner.

    The winners will be determined by several methods:

    1 - Speed
    2 - Understandability (ease of verification)
    3 - Readability (how the code was written and commented)
    4 - Method used
    5 - Originality

    Notes:

    File must be read and processed in 64kb chunks to allow any size file to be scanned.


    Permutation Variations:

    Variable length.
    Fixed length.
    No repeating characters.
    Repeating characters.

    Your program need not be able to handle all of the given variations but it is a list that you could work from.

    I would like to have several category of winners because speed does not always determine the needed solution (some methods won't be able to generate the exact log file but will still be correct). But you still need to generate a type of log file to verify your claim.

    I would like to have this contest (challenge) run for about three months to give everyone a chance to work the problem. It would be nice if your code was self verifying (some methods won't allow this). This means that it prints out a report of where it found the permutation, what permutation it was and a count of each permutation. in the format of File Offset, Permutation in sorted order. It would be really nice to have the program check against the provided list to verify itself for the known permutations. I have also supplied the elements in the index file in csv format for this purpose.

    Code should be sent ready to execute (please check your submission and make sure that all forms, modules and classes load from the same folder as the project). Code should have timing output using the GetTickCount API so that all timings are consistent and MUST use Option Explicit in all forms/modules/classes. All output should be in the format of the file FindStrSearch included in the zip file. Screen output is also appreciated.

    The test file for download is too big for VBForums so you will need to download it from here Permutations File (Updated 4/18/2007).
    This file is a simple test with all known permutations totally within each 64k boundary.

    After 2 months are up I will deliver a more complex and final file that has more challenges. All code MUST be VB6 code but can use Windows API's. No external code or calls other than VB6 and Windows API's will be accepted. This means no custom dll's written in other languages. You can use any original references and components supplied to support VB6 from Microsoft.

    You have until July 14, 2007

    Code well. If you have some suggestions please let me know...

    DO NOT POST YOUR ENTRIES!!!!
    WE WANT ALL ENTRIES TO BE ORIGINAL WORK.


    All entrants must let me know if they want to enter prior to submitting project...

    You will need to email your entries to contest001 at randem dot com.
    Source code only.


    All code submissions that qualify will be compiled into a project and released on the *********** website as well as in the CodeBank Forum of VBForums for others to download, view and use. No rights to any code will be retained by the submitter. Submitters will be given complete credit for their submission in all postings.

    Note: Please use your VBForums name in the submission. I have no idea of who you are without the cross reference.
    Attached Files Attached Files
    Last edited by randem; Jun 5th, 2007 at 08:47 PM.

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