CSCI 379 homework 0: getting started

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.

Join the CSgit AI group, init a repo.

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.

Clone the starter code repo

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.

Set up your hw0 repo

The starter code repository has a hw0 directory. In your own repository:

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

Write some code

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 module

Yes, this is artificial and a bit silly but I want you to go through all the motions now in preparation for later.

Complete the writeup

You should also complete the writeup. In that file, include your name, and respond to these prompts.

  1. What’s your experience with the technology stack we’ll be using in this course? We’ll be using Python and common libraries such as 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.)

  1. 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.

  2. 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.

Submit your assignment

Commit your changes and push to your CSgit repository. That’s your submission.

Several things to observe:

Requirements; how you’ll be assessed

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:

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.