ComiCS
Consider the comic below.
Source: unknown
-
(2 points.) In no more than three sentences, what is a cookie, in technical terms, in the context of HTTP?
-
(2 points.) In no more than three sentences, how do cookies enable data collection?
Consider the comic below.
Source: xkcd.com/327
-
(2 points.) In no more than three sentences, what is a SQL injection attack, in technical terms?
-
(2 points.) In no more than three sentences, why should you use a library like CS50’s own to format SQL statements with placeholders (e.g.,
?
) rather than use, e.g., Python’s own f-strings (with curly braces) to format statements yourself?
Consider the comic below.
Source: FoxTrot
- (2 points.) In a file called
foxtrot.py
, implement precisely the same program in Python.
Consider the comic below.
Source: xkcd.com/149
- (2 points.) Among the Linux commands we didn’t introduce this term is
sudo
. In no more than three sentences, exactly what doessudo
do?
Consider the comic below.
Source: dilbert.com/strip/2017-01-02
Not only has code.cs50.io enabled you to use VS Code in the cloud, without installing it on your own Mac or PC, it has also had clang
, python
, sqlite3
, http-server
, and flask
pre-configured for you. While you’re welcome to continue using your codespace after term’s end, let’s also prepare you to write, at least, Python on your own Mac or PC!
-
(1 point.) Complete each of the steps below. You might encounter some technical difficulty along the way, but that’s why this problem is at term’s end rather than start!
-
Download VS Code from code.visualstudio.com and install it on your own Mac or PC, per these instructions. If you have a Chromebook, though, you may skip this problem or try these instructions instead.
-
Download the latest version of Python from python.org/downloads and install it on your own Mac or PC.
-
Launch VS Code on your own Mac or PC and create a new file called
hello.py
containing just the below:print("hello, world")
Save the file and execute the below in VS Code’s terminal window. You might need to
cd
first to the directory withhello.py
.python hello.py
If the command is not found, try
python3
instead ofpython
, else you might also find search results like google.com/search?q=add+python+to+path of help. Alternatively, for this problem and this problem only, you are welcome to ask another human for help. -
As soon as “hello, world” prints as expected, take a screenshot (showing your code and your terminal window) and submit it as your answer to this problem.
-