Python Programming Assignment

Update (10/24): 

  • The file hashtable.py has been updated and now includes some code to get started with unittest (go to MS Teams to download it).
  • You will want to download hashtable.py and add onto it, rather than importing it from a new file you create (since you won’t be able to extend the class across separate files).
  • Yes, there is some redundancy between unit tests and the file test_hashtable.py. I am using test_hashtable.py in order to both test and interact with your class (more easily). If your unit tests are thorough/comprehensive, then it will likely look similar to the final version of test_hashtable.py that I will use. 

The tasks in this assignment are to extend the HashTable class that is currently defined in the file “hashtable.py” (located in MS Teams -> General -> Files -> Code). 

By extending it we will increase the functionality of the HashTable class (by adding more methods) and will make it more flexible (e.g. can resize itself as needed) and robust (e.g. no issues/errors when it is full and an item is added). 

The ways to extend the class, and thus the requirements for this assignment are as follows. 

1. Override Python len() function to work with HashTable in a specific way – Using def __len__ will override the Python len() function. The way this is implemented should be to return the number of items stored in the hash table (note: this is *not* the same as HashTable’s “size” field). 

2. Override Python in operator – This will be done using def __contains__ and should be implemented so this operator will then return a boolean when used in statements of the form  54 in myhashtable. For this example, the function should return True if 54 is an existing key in the HashTable instance myhashtable, and False if it is not. 

3. Override Python del operator – This is done by  using def __delitem__ and should allow for a key/value pair to be removed from an instance of HashTable (e.g. del h[54]). Think about how you want to handle cases when deleting a key that was involved with collisions. Be sure to include in the documentation for this method any assumptions/restrictions on how this can be used. 

4. Modify exiting put method to resize an instance as needed – The current HashTable implementation is limited in that it is not able to gracefully handle the case when an item is added to already full HashTable instance. This method should be modified to deal with this more gracefully, and should resize the instance for the user. Be sure to include documentation here describing exactly when you choose to resize and how you select an appropriate new size (remember that prime numbers are preferred for sizes, in order to avoid clustering, or an even more severe but subtle issue). 

All of those methods should be clearly documented to describe how and why the implementation is defined as it is. You will also want to use unittest on this assignment. One good use case for unittest will be to add a few items (and maybe even delete) one, and then to use unittest to verify that the slots and data fields are equal to what you expect. All of the extensions that you’ve added should be tested as well.  

Lastly, for grading, you will want to ensure that you’re program can be run through a test script. The test script will look like the code shown at bottom of this assignment description. When it is run we should expect output similar to what is shown in this screenshot.

test_hashtable.py (the final test script will vary slightly from this):

from <> import HashTable

# instantiate a HashTable object
h = HashTable(7)

# store keys and values in the object
h[6] = ‘cat’
h[11] = ‘dog’
h[21] = ‘bird’
h[27] = ‘horse’

print(“-“*10, “keys and values”, “-“*10)
print(h.slots)
print(h.data)

# check that data was stored correctly
print(“-“*10, “data check”, “-“*10)
if h.data == [‘bird’, ‘horse’, None, None, ‘dog’, None, ‘cat’]:
    print(”    + HashTable ‘put’ all items in correctly”)
else:
    print(”    – items NOT ‘put’ in correctly”)

# check that ‘in’ operator works correctly
print(“-“*10, “in operator”, “-“*10)
if 27 in h:
    print(”    + ‘in’ operator correctly implemented”)
else:
    print(”    – ‘in’ operator NOT working”)

# delete operator
del h[11]

# check that len() function is implemented and works
print(“-“*10, “len() function”, “-“*10)
if len(h) == 3:
    print(”    + ‘len’ function works properly”)
else:
    print(”    – ‘len’ function NOT working”)

# “in” operator (returns a boolean)
print(“-“*10, “len() after deletion”, “-“*10)
if 11 not in h:
    print(”    + ‘in’ operator works correctly after 11 was removed”)
else:
    print(”    – ‘in’ operator OR ‘del’ NOT working”)

# check that data was also removed
print(“-“*10, “data after deletion”, “-“*10)
if h.data == [‘bird’, ‘horse’, None, None, None, None, ‘cat’]:
    print(”    + data is correct after deletion”)
else:
    print(”    – data not correctly removed after deletion”)

MatLab Project

I have a MatLab project I provided the entire project I only need Exercise 6 done (not the entire project). I highlighted the section that needs to be done as well. Please look over the entire project to see how exercise 6 fit in with the entire project. This project is due project on Sep 27. 

AUtomated Code Review: WebGoat source code using the VCG SAST tool and verify the findings within the code.

 
For this assignment, My task is to scan the WebGoat source code using the VCG SAST tool and verify the findings within the code. In particular, you will be be using VisualCodeGrepper, which is an open-source SAST tool running on Windows. It supports multiple programming languages(C++, C#, VB, PHP, Java, and PL/SQL).. Prepare a simple report based on OWASP Findings Report Guide, and submit the report in a PDF format   There should be a section summarizing all the findings by:

  1. Risk level
  2. OWASP Top 10 Threats

To install VCG and run your scans, follow these instructions:

  1. Download WebGoat 8.0 from GitHub in a zip format.
  2. Extract the zip file into a directory.
  3. Download VCG from the project page.
  4. Install VCG on a Windows machine. Consider the system requirements on the project page.

Intro to Data Mining

You will need to ensure to use proper APA citations with any content that is not your own work.

Question 1

Suppose that you are employed as a data mining consultant for an Internet search engine company. Describe how data mining can help the company by giving specific examples of how techniques, such as clustering, classification, association rule mining, and anomaly detection can be applied.

Question 2

Identify at least two advantages and two disadvantages of using color to visually represent information.

Question 3

Consider the XOR problem where there are four training points: (1, 1, −),(1, 0, +),(0, 1, +),(0, 0, −). Transform the data into the following feature space:

Φ = (1, √ 2×1, √ 2×2, √ 2x1x2, x2 1, x2 2).

Find the maximum margin linear decision boundary in the transformed space.

Question 4

Consider the following set of candidate 3-itemsets: {1, 2, 3}, {1, 2, 6}, {1, 3, 4}, {2, 3, 4}, {2, 4, 5}, {3, 4, 6}, {4, 5, 6}

Construct a hash tree for the above candidate 3-itemsets. Assume the tree uses a hash function where all odd-numbered items are hashed to the left child of a node, while the even-numbered items are hashed to the right child. A candidate k-itemset is inserted into the tree by hashing on each successive item in the candidate and then following the appropriate branch of the tree according to the hash value. Once a leaf node is reached, the candidate is inserted based on one of the following conditions:

Condition 1: If the depth of the leaf node is equal to k (the root is assumed to be at depth 0), then the candidate is inserted regardless of the number of itemsets already stored at the node.

Condition 2: If the depth of the leaf node is less than k, then the candidate can be inserted as long as the number of itemsets stored at the node is less than maxsize. Assume maxsize = 2 for this question.

Condition 3: If the depth of the leaf node is less than k and the number of itemsets stored at the node is equal to maxsize, then the leaf node is converted into an internal node. New leaf nodes are created as children of the old leaf node. Candidate itemsets previously stored in the old leaf node are distributed to the children based on their hash values. The new candidate is also hashed to its appropriate leaf node.

How many leaf nodes are there in the candidate hash tree? How many internal nodes are there?

Consider a transaction that contains the following items: {1, 2, 3, 5, 6}. Using the hash tree constructed in part (a), which leaf nodes will be checked against the transaction? What are the candidate 3-itemsets contained in the transaction?

Question 5

Consider a group of documents that has been selected from a much larger set of diverse documents so that the selected documents are as dissimilar from one another as possible. If we consider documents that are not highly related (connected, similar) to one another as being anomalous, then all of the documents that we have selected might be classified as anomalies. Is it possible for a data set to consist only of anomalous objects or is this an abuse of the terminology?

Information Security and Risk Management

 

1.Discuss why a computer incident response team (CIRT) plan is needed, and its purpose.

2.Why are the roles and responsibilities important to be listed and kept updated for a CIRT plan.

3.Connect the dots: Discuss your understanding of the CIRT incident  handling procedures, the role policies play, and the importance of  communication escalation procedures.

4.What are some best practices for implementing a CIRT plan? Do some personal research to answer this questions.

java codes

I attched 2 files. 1- has questions 2- codes and method to answers the questions just change the information to use my information like my name and ID number ,and my age 30 years old.  

mid term 10 questions

 

A researcher wanted to know if there was a significant difference in cyber security breaches between cities on two different continents.  What test should he conduct to determine if there is a significant difference in cyber security breaches between the continents?  Write up the results and determine what do the results mean? 

Here is the data set:

Asia

Europe

17

20

25

30

26

15

27

14

28

12

50

bitcoin economics research paper

 Bitcoin Economics.  For this week’s research paper, search the Internet and explain why some organizations are accepting and other organizations are rejecting the use of Bitcoins as a standard form of currency.  Your paper needs to identify two major companies that have adopted Bitcoin technology as well as one that has refused accepting Bitcoin as a form of currency. Be sure to discuss each organization, how they adopted (or why they won’t adopt) Bitcoin, and what recommendations you have for them to continue to support Bitcoin (or why they should support Bitcoin). 

5 pages , APA format, 3 scholar references