This is a very simple assignment whose purpose is to shake out any logistical snafus. It’s a sort of Hudson Bay start to ensure that once we get into “real” assignments you understand the process and have it working.
We will be using the csgit.stolaf.edu gitlab server for
code submission and so on for this course: in particular, we’ll use the
AI group on CSgit.
You should have received an invitation to join the F26 subgroup. Go to the
subgroup and create a repository with your St. Olaf username as the
repository’s name. Your username is the portion of your email that comes
before the @ symbol. For example, Prof. Drake’s username is
drake3. This repository is where you will submit your
coding assignments throughout the semester.
After you create your repository, you must add yourself as a maintainer. To do this, click the “Manage” heading on the side bar. Then, click members. Finally, click the “Invite members” button in the top right corner. This will create a pop-up. Enter your username, change your role to “Manager”. You may leave access expiration date empty. If you do not do this before next Friday, you will lose access to your repository and will need to come to my office hours to restore it.
Starter code, library modules, template files and the like are in the
379-starter-code
repo Clone that. If I make any updates as the semester progresses,
you can just pull to get up-to-date.
hw0 repo¶The starter code repository has a hw0 directory. In your
own repository:
hw0 directoryhelpers.py file from the starter code
hw0 directoryhw0-starter.py file and name it
hw0.py.hw0-writeup.txt.We will use this “hwN” convention for the directory and
main submission file through the semester. Following it is one of the
requirements of your homework assignments, and failing to do so will
result in one one or more “Revision needed” marks, since you have not
met the requirements.
(However, if you’d like to submit your writeup in some other convenient text format like markdown – or perhaps TeX, emacs org-mode, or even clean, human-editable html – that’s fine.)
Just to faithfully represent the full assignment submission process, write some code! You’ll implement the classic FizzBuzz algorithm, which will work as follows:
The output will consist of numbered lines. Each line will start with the number, then a colon, a space, and some text. The text will be “FIZZ” for numbers divisible by 3, “BUZZ” for numbers divisible by 5, and “FIZZ BUZZ” for numbers divisible by both.
Your program will accept two commandline arguments: a start and end
number. It will print the corresponding lines from the start to the end,
following the Python convention of not including the ending index. For
example, python hw0.py 9 17 would output
9: FIZZ
10: BUZZ
11:
12: FIZZ
13:
14:
15: FIZZ BUZZ
16:
If the start and end are the same, it should output nothing; if the end is less than start, or one of them is not an integer, the behavior is undefined and it can do anything you like. Make it something interesting if you like. (Do note, though, that if the “anything” is, say, “exploit a hitherto-unknown privilege escalation bug in the Linux kernel to gain root and erase Professor Drake’s hard drive”, you should be able to predict exactly what grade you’ll receive for the course…)
To exercise the use of helper code, your own program
must import the helpers module and when
printing the “fizz” and “buzz” output, use helpers.fizz and
helpers.buzz. That is:
print(f"{n}: FIZZ") # not acceptable: uses string literal FIZZ
print(f"{n} {helpers.fizz}") # acceptable! Uses the helpers moduleYes, this is artificial and a bit silly but I want you to go through all the motions now in preparation for later.
You should also complete the writeup. In that file, include your name, and respond to these prompts.
numpy, scikit-learn, pytorch. I
will assume you have basic fluency in Python, and will show you how to
use those libraries. If you are at all concerned about your ability
with Python, contact me right away and we’ll get you to speed.
If you are very good with Python and would be willing to be
matched with a student who’s not so confident and would like to be a
“Python mentor”, contact me and I’ll match you up.(Now go see the course syllabus. Review the section on the engagement and participation component of your grade, and the various sections that address treating this class like a community. Being a Python mentor – and also a mentee! – is a spectacular form of engagement and community-building, and doing so would be reflected in that component.)
Just my curiosity: what OS, IDE, and so on do you use? I use Linux, am one of those people that live in emacs (though sometimes with Python I’ll use PyCharm/IntelliJ or VS Code. How about you? Also, how do you use git? From inside your IDE? The command line? Some other program? I do a lot on the command line, though I do like magit.
If you have any other questions or comments on any part of this process, go ahead and include them.
I don’t have any particular format in mind; please use something clear, well-structured, and very readable. Keep in mind that either me or our TA will be reading many of these and appreciate effective, efficient communication.
Commit your changes and push to your CSgit repository. That’s your submission.
Several things to observe:
You can (and should!) make lots of small commits and do many pushes to your upstream repo.
When grading assignments, we will use the last commit before the assignment deadline, taking into account any late tokens. You are free to make further commits if you just want to add something. You can also fix genuine flaws in your code, but we will use that last-before-the-deadline commit as your initial submission. If we do revisions of homework assignments, those will use this same process, so don’t be too chary of making further commits to improve your code.
This section of the posted assignments will describe more details about how we will test and evaluate your code. There’s not much for this assignment, but in general:
Your code must work for all the specified behavior and examples. The text above describes some of the behaviors for your program. If it does not conform to those, you will not receive full credit. It gives an example output for a given output – your code must exhibit that behavior.
Your code must conform to any specifications in the assignment. Correct black-box behavior is only the start. Above there’s a description of some unacceptable code; your own should, of course, not include any such usage.
Your code must display good, idiomatic style and readability. Remember that the person grading your assignment is grading many other assignments, and that this can be a time-consuming, tiring process. Make it as easy as possible for that person to read your code and apprehend your understanding.
The big picture here: the grading system in this course tries to align, as closely as possible, these two things: first, the idea of “what do I need to do to get the grade I want?” or “how do I get full credit?” or such; and second, making your understanding obvious. The intent is that any time you wonder what to do to get credit, get a good grade, or anything like that, that you are guided by a question like “what can I do to make it obvious what I’ve learned?”
In this particular situation, you write high-quality, readable, Pythonic code because doing so makes it easier for us to see what you have learned, but the principle applies throughout your work in the course.