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”)

IW2D1

In order to have a successful IG program, one of the eight (8) Information Risk Planning and Management steps is to develop metrics and measure results. From your required readings, discuss the value that metrics brings to the organization, and identify critical measures of success that should be tracked.

250-300 words with a minimum of 2 references in APA format

data analysis

 Find something that you are passionate about.  Find a dataset that speaks to that passion.  You can choose from:

– kaggle.com

– https://lionbridge.ai/datasets/10-open-datasets-for-linear-regression/

– https://careerfoundry.com/en/blog/data-analytics/where-to-find-free-datasets/

OR ANY REPUTABLE SOURCE OF DATA.

Write a 2 page (minimum) paper.  In the paper, define the problem that you are analyzing.  What is the question that you want to be answered from the data?  What is your hypothesis?

25%:  Analysis of the dataset (explain the data and also perform a statistical analysis).  Speak to which features you kept and why. 
25%: Use the techniques learned in this class and discover at least 1 “AHA” in the data.  By that, I mean that I expect you to discover a relationship between two variables or an INSIGHT into the data.  Explain your findings.
25%: Define which visualization(s) you choose to use and why you chose them.  I expect the visualizations to be professional and readable by themselves without references to anything else.  (I am not going to be looking through your data to try to understand your visual).  Attach your visuals to the end of the document.  Create a Tableau Story that combines your visuals and provide the link to it in the document.
15%: Summarize your work from a social or business perspective.  Why is this important?  How could this insight be used to make a difference?

CITE YOUR SOURCES and add them to the end of your paper.  (I recommend citefast.com.  You can cite all of your sources there and export to word and just add it to the end of your paper.)

In summary – you will turn in:

A 2-page Analysis

A page (or 2) of Visualizations

A list of your sources/references

online paper

 

  • Kuhn, M. (2019, March 27). The caret package. Github. https://topepo.github.io/caret/

 Outline for Assignment 1

  • Refer to the Documenting Research Guide for assistance in organizing your research and developing your outline.
  • You can find this guide in the Useful Information folder, as well.

 Using the research guide and the assignment 1 instructions, develop your outline. Submit the outline in an MS Word document file type. Utilize the standards in APA 7 for all citations or references in the outline. Ensure that the document includes your name. Do not include your student identification number. You may use the cover page from the student paper template, but it is not required.

 The assignment 1 instructions are at the bottom of this content folder.Submit your outline on or before the due date.By submitting this paper, you agree:

(1) that you are submitting your paper to be used and stored as part of the SafeAssign™ services in accordance with the Blackboard Privacy Policy;
(2) that your institution may use your paper in accordance with UC's policies; and
(3) that the use of SafeAssign will be without recourse against Blackboard Inc. and its affiliates.

Using JCA in Java- 5pgs due in 5hrs

Estimation of time required for brute-force search attack on the password-based encryption

(To use the attached program, do not use your own program,please)

This assignment asks you to estimate the time required for successful brute-force search attack on password-based encryption using JCA in Java. It assumes that you have done Lab 1, Lab2, Lab3 (see attachment).

Make a list of passwords, mentioned in item 3 of Section 1.2 of Lab 1 instructions (page 2)

For password-based DES encryption implementation in JCA (Lab 2 and Lab 3) fix some salt and iteration count and record an average time required for encryption/decryption (done in Lab 3);

For each of the passwords above estimate the time required for successful brute-force search attack, assuming that an attacker knows:

• the predefined plaintext;

• the ciphertext produced;

• the salt;

• the iteration count;

• but no password.

Investigate how the time required for the attack depends on the iteration count;

Consider a variant of the attack, in which an attacker knows everything as above, except the iteration count, and estimate the time required to recover the passwords;

Compare your estimated time with the estimated time returned for the same passwords by online services (Lab 1, page 2) and propose plausible explanation of any observed differences.

Write a report on the above, providing an evidence for your arguments (e.g. snippets of code used to estimate time required for one encryption).

Analyze Current Security Products and Services

 

Complete a three to four-page report with APA cited references to support your work.

Searching for Vendor Information (without getting a ton of sales calls)

It is often helpful to research a Vendor and their products before contacting the company, (when you contact the company, you often are inundated by sales calls). Your assignment this week is to gather information on a provider of security/privacy products and write a short recommendation document. Include in your report:

  • types of services this vendor provides
  • facts about this company that would lead to their reliability as a provider
  • how they compare to other similar vendors (you will need to look at a few companies to gather this information).