This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def binarySearch(data_list, low, len, x): | |
| ''' | |
| binary Search | |
| :param data_list: inputdata : list | |
| :param low: lowest element of list typical 0 | |
| :param len: len of array (n - 1) | |
| :param x: searched value | |
| :return: index of searched element | |
| ''' | |
| while low <= len: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Host Enumeration: | |
| --- OS Specifics --- | |
| wmic os LIST Full (* To obtain the OS Name, use the "caption" property) | |
| wmic computersystem LIST full | |
| --- Anti-Virus --- | |
| wmic /namespace:\\root\securitycenter2 path antivirusproduct |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import pandas as pd | |
| if __name__ == '__main__': | |
| dat = [2, 4, 4, 9, 12] | |
| df = pd.DataFrame(dat) | |
| print(df) | |
| dat_2dim = [['Hot Dog', 3],['Hamburger', 2.5],['Cheeseburger',2],['Cola', 2]] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import numpy as np | |
| import pandas as pd | |
| nan = np.nan | |
| median_1 = np.median([1,2,3]) | |
| median_2 = np.median([0,1,2,3]) | |
| median_3 = np.median([0,0,1,2,3]) | |
| median_4 = np.median([0,0,0,1,2,3]) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # flat a list of lists, which contains multiple stacked lists | |
| # | |
| # expected input: | |
| # [a, b, c, [1, 2, 3, [9, 3, 5,6 ]], e, ] | |
| # | |
| # output should look like: | |
| # [a, b, c, 1, 2, 3, 9, 3, 5, 6, e] | |
| def flat_listoflists(input_list, final_list=None): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def write_file(path): | |
| ''' | |
| :param path: Path for file | |
| :return: nothing | |
| ''' | |
| file = open(path+'temp21.log', 'w') | |
| file.write('success') | |
| file.close() |