Are you ready for MPCS 51083?
Students sometimes struggle to keep up with homework assignments due to limited experience with Python and knowledge of the Linux command line. If you're planning to sign up for this class take a few minutes to review the following; if you have doubts about your proficiency in these areas please talk with me before registering.
Python Proficiency
Consider the code snippets below. I expect that you can determine the result within a few seconds, without consulting any external source.
# Sample 1
a_list = [[5, 2], [9, 4], [3, 3]]
a_new_list = sorted(a_list, key=lambda x: x[1])
print(f"The new list is {a_new_list}")
# Sample 2
if 'object_id' in request:
response['fname'] = request['object_id'][:request['object_id'].index("~")][-36:]
else:
response['fname'] = 12 * '0x0'
# Sample 3:
import os
import json
content = json.loads(request.body)
working_dir = content['fpath']
file_name = content['fname']
if not os.path.exists(working_dir + file_name):
os.makedirs(working_dir + file_name)
Command Line Proficiency
You should be comfortable writing commands and scripts like the samples shown below.
# Sample 1:
aws ec2 describe-instances --output text | grep RESERVATIONS | awk '{print $3}'> sec_groups
# Sample 2:
export MPCS_LOGS_ROOT=./log/
export MPCS_LOG_FILE=mpcs.log
[[ -d ./log ]] || mkdir $MPCS_LOGS_ROOT
if [ ! -e $MPCS_LOGS_ROOT/$MPCS_LOG_FILE ]; then
touch $MPCS_LOGS_ROOT/$MPCS_LOG_FILE;
fi
If you understand the commands covered in the MPCS Unix Bootcamp, you should be OK. In addition, William Shotts's The Linux Command Line is a very approachable tutorial/reference for those new to the command line.
Web Programming Proficiency
While this is not a web development course, our programming assignments are all related to building and interacting with web services via APIs. At minimum, you should be familiar with:
- HTTP request-response mechanisms, including request headers and response codes
- HTTP verbs and their appropriate use (e.g. using GET vs. POST)
- The REST (REpresentational State Transfer) architectural style and approach—check out this nice summary if you're a little rusty
- Simple HTML forms (input field and tables) and basic CSS
- Working with JSON, and especially Python's
json
library
The Real Python guide to requests has a good introduction with simple examples that you can test using Postman, a very versatile API development tool.