
WRITE SIMPLE CODE FROM MY LOGIC (SQL or other)
- or -
Post a project like this2447
                    £15(approx. $20)
        - Posted:
 - Proposals: 4
 - Remote
 - #2277256
 - Awarded
 
Description
                Experience Level: Entry            
                
            /*
--- installs .txt/ SQL table / csv
//tab seperated .txt document *OR* sql database table *OR* .csv with up to *10 million* lines of tab seperated install values: machine, app manufacturer, app, version, unique hash / concat (ad maybe more info)
>machine appman appname appversion hash
>A MS Word 10 MSWORD10
>B MS Word 10 MSWORD10
>C MS Word 10 MSWORD10
>D MS Word 10 MSWORD10
>A MS Excel 10 MSEXCEL10
>B MS Excel 10 MSEXCEL10
>C MS Excel 10 MSEXCEL10
>A ACME Plugin 11 ACMEPLUGIN11
>B ACME Plugin 11 ACMEPLUGIN11
>C ACME Plugin 11 ACMEPLUGIN11
>A IBM Notes 10 IBMNOTES10
>B IBM Notes 10 IBMNOTES10
>C IBM Notes 10 IBMNOTES10
>D IBM Notes 10 IBMNOTES10
>B ORACLE Java 1 ORACLEJAVA1
>C ORACLE Java 1 ORACLEJAVA1
>D ORACEL Java 1 ORACLEJAVA1
*/
//I want to get the signature of each app family. In the above, MSExcel and ACMEPlugin should show up as a family; as would MSWord and IBMNotes as they are installed on the same machines.
//Logic below would give a false positive where apps are installed on all machines (ORACLEJAVA would incorrectly report IBMNotes as its family, so a comparison would be required to show they both report family correlation)
//Can be in any language and by any method but batch / vb / powershel / sql prefered as more portable and easier to understand / edit (i've done a little Java and batch and a little vb and sql)
//Would be nice to have comments describing what's happening for easy modification
//Output: families .txt/ table / view / csv
>Hash CompareHash SWCount Percent_Match
>MSWORD10 MSEXCEL10 3 75
>MSWORD10 ACMEPLUGIN11 3 75
>MSWORD10 IBMNOTES10 4 100
>MSWORD10 ORACLEJAVA1 3 75
>ACMEPLUGIN11 MSWORD10 3 100
>ACMEPLUGIN11 MSEXCEL10 3 100
>ACMEPLUGIN11 IBMNOTES10 3 100
>...
>...
//begin logic (this is how it looks in my head to give you an understanding of the logic)
//set percentage threshold for family identification
set var_percent_threshold = 70
//list distinct applications from [installs]
set array_or_table_distinct_apps = select distinct [hash] from [installs]
/*
--- array_or_table_distinct_apps
>MSWORD10
>MSEXCEL10
>ACMEPLUGIN11
>IBMNOTES10
>ORACLEJAVA1
*/
// start a loop for each line in the above
for each i in [array_or_table_distinct_apps]
(
//list machines that have the app installed
set array_or_table_app_on_machines = select distinct [machine] from [installs.txt] where [hash] = i
//for example, if i = ACMEPLUGIN11
/*
--- array_or_table_app_on_machines
>A
>B
>C
*/
//get count of machines
var_machine_count = count [machines] in [array_or_table_app_on_machines]
//- 3 in the case of ACMEPLUGIN11 (A, B, C)
//write to table all the other apps that exist on the above machines where the match rate is greater than the threshold (see attached .txt file)
ACMEPLUGIN11 ORACLEJAVA1 2 66.6 // java would get dropped at 66.6%
*/
//echo to families .txt/ table / view / .csv
Next
//do for all lines in array_or_table_distinct_apps
End
//exit gracefully
        
    --- installs .txt/ SQL table / csv
//tab seperated .txt document *OR* sql database table *OR* .csv with up to *10 million* lines of tab seperated install values: machine, app manufacturer, app, version, unique hash / concat (ad maybe more info)
>machine appman appname appversion hash
>A MS Word 10 MSWORD10
>B MS Word 10 MSWORD10
>C MS Word 10 MSWORD10
>D MS Word 10 MSWORD10
>A MS Excel 10 MSEXCEL10
>B MS Excel 10 MSEXCEL10
>C MS Excel 10 MSEXCEL10
>A ACME Plugin 11 ACMEPLUGIN11
>B ACME Plugin 11 ACMEPLUGIN11
>C ACME Plugin 11 ACMEPLUGIN11
>A IBM Notes 10 IBMNOTES10
>B IBM Notes 10 IBMNOTES10
>C IBM Notes 10 IBMNOTES10
>D IBM Notes 10 IBMNOTES10
>B ORACLE Java 1 ORACLEJAVA1
>C ORACLE Java 1 ORACLEJAVA1
>D ORACEL Java 1 ORACLEJAVA1
*/
//I want to get the signature of each app family. In the above, MSExcel and ACMEPlugin should show up as a family; as would MSWord and IBMNotes as they are installed on the same machines.
//Logic below would give a false positive where apps are installed on all machines (ORACLEJAVA would incorrectly report IBMNotes as its family, so a comparison would be required to show they both report family correlation)
//Can be in any language and by any method but batch / vb / powershel / sql prefered as more portable and easier to understand / edit (i've done a little Java and batch and a little vb and sql)
//Would be nice to have comments describing what's happening for easy modification
//Output: families .txt/ table / view / csv
>Hash CompareHash SWCount Percent_Match
>MSWORD10 MSEXCEL10 3 75
>MSWORD10 ACMEPLUGIN11 3 75
>MSWORD10 IBMNOTES10 4 100
>MSWORD10 ORACLEJAVA1 3 75
>ACMEPLUGIN11 MSWORD10 3 100
>ACMEPLUGIN11 MSEXCEL10 3 100
>ACMEPLUGIN11 IBMNOTES10 3 100
>...
>...
//begin logic (this is how it looks in my head to give you an understanding of the logic)
//set percentage threshold for family identification
set var_percent_threshold = 70
//list distinct applications from [installs]
set array_or_table_distinct_apps = select distinct [hash] from [installs]
/*
--- array_or_table_distinct_apps
>MSWORD10
>MSEXCEL10
>ACMEPLUGIN11
>IBMNOTES10
>ORACLEJAVA1
*/
// start a loop for each line in the above
for each i in [array_or_table_distinct_apps]
(
//list machines that have the app installed
set array_or_table_app_on_machines = select distinct [machine] from [installs.txt] where [hash] = i
//for example, if i = ACMEPLUGIN11
/*
--- array_or_table_app_on_machines
>A
>B
>C
*/
//get count of machines
var_machine_count = count [machines] in [array_or_table_app_on_machines]
//- 3 in the case of ACMEPLUGIN11 (A, B, C)
//write to table all the other apps that exist on the above machines where the match rate is greater than the threshold (see attached .txt file)
ACMEPLUGIN11 ORACLEJAVA1 2 66.6 // java would get dropped at 66.6%
*/
//echo to families .txt/ table / view / .csv
Next
//do for all lines in array_or_table_distinct_apps
End
//exit gracefully
Steven B.
100% (20)Projects Completed
6
Freelancers worked with
7
Projects awarded
73%
Last project
15 Sep 2019
United Kingdom
New Proposal
Login to your account and send a proposal now to get this project.
Log inClarification Board Ask a Question
- 
There are no clarification messages.
 
We collect cookies to enable the proper functioning and security of our website, and to enhance your experience. By clicking on 'Accept All Cookies', you consent to the use of these cookies. You can change your 'Cookies Settings' at any time. For more information, please read ourCookie Policy
Cookie Settings
Accept All Cookies