Intro. to Comp. Sci (year) - 1

Fall 2020 -- Peter Brooks

Semester feedback form.
Please fill out the feedback form thoughtfully, by Thursday morning.
Model Video -- Extra Credit (optional)

Due: Fri 1/22 midnight.
Here are the instructions and requirements for the video, which includes the program to show you what models your classmates have already registered.

Make sure that you upload both your model name (to register) and eventually, your model name (again) and the video file itself to the "Model Video" homework slot.
Image Processing

Homework due:
Sat (1/16) midnight for (p8,9,10)
Tue (1/19) morning for (p3,4)
First steps:  Here's a small Image Processing Model.  And here are some pictures to go along with it: car.jpg, duckCat.jpg, apartment.jpg, apartment2.jpg.  To use the model, copy the model and the pictures into the same directory on your hard drive.

Homework:  Download this model.  Add code to the buttons that don't have them.
Homework makeup:
Now or never.

Final deadline for previous assignments makeup:
Sat. 1/9/21 midnight.
Now is the ONLY time to go back to making up previous assignments you haven't submitted, or you have submitted but has not been graded.  Do this before too much time passes, and other classes start squeezing your heads.

Here's the algorithm to get them graded:  Go to the homework server:
1. Go to Grades, and find all the assignments for which you have gotten a grade = 0.
2. Write down the names of those assignments.
3. Do those assignments (if you haven't done them already).
4. For those assignments you've just finished, upload each to its CORRECT SLOT on the homework server.
5. Once finished with however many you did: send me email with your name, period, and the names of all the missing/ungraded assignments you'd now like graded.
6. Late charges apply.
7. As they say on late-night television: offer not valid after 1/9/21 11:59pm.
The Game of Life! Check it out in the Models Library: Computer Science/Cellular Automata/Life, and in Wikipedia
Basic mechanics of Life
Some small structures
A large set of interesting discovered patterns in Life.
Download and run Golly, the remarkable cellular automata emulator
Snake! in Netlogo app
or on the web
 
The Moving-Stripe Puzzle This works.  But this doesn't.  Why?
Here's the code showing how to solve this problem.
Netlogo Test-Test
Due: Wed. 12/23 midnight. 
There is, however, a period of true grace until Sun 12/27 midnight, after which late penalties apply.
 
State Variables Homework, due
Sat, 12/18 midnight (p3,4)
Mon, 12/21 midnight (not 8:00a) (p 8,9,10)

Here's my answer.
Here is the homework.  As usual, duplicate the model.  Its actions are simple enough that you Mac folks can remember what it does while creating a brand new model.  Read the Info tab!

Here is the demo model, with code and some Info.
Here is a more complicated state-variables model, with turtles pausing...
...and a wintertime state-variables model.
Mouse-Control
Homework on mouse-control, due
Wed, 12/16 (p 3,4)
Thurs 12/17 (p 8,9,10)

Answers
Watch the Mouse-Control videos (20A and 20B).

Here is the Mouse-Control homework in webpage form.  Create a model of your own and save (in the normal ".nlogo" form -- not the web form) and upload it as usual.

Here are a couple of models to show mouse-control:
One-shot-trigger.nlogo
PickingAndDragging.nlogo
Homework on randomness -- called "Turtle Health", due:
Mon, 12/14 (p3, 4)
Tue, 12/15 (p8, 9, 10)

Answers
Watch the NetLogo video #17: on Variables of all types.

Here's a demo of the use of Turtles-own and Patches-own and Turtle-Patch interaction.  Look at the model, the Info tab and the code to see how it's done.

The homework:
download and duplicate this model .  DO NOT just add code to my model, create your own from scratch.  You may copy (duplicate) everything you see in the Interface tab.  Read the Info tab for details.

For class-work only: download this model of turtles hatching and dying and try to re-create it
Here's my actual code for the classwork above.
Shape/Locomotion class competition

Judging deadline: Thurs, 12/10 midnight

Results are now posted.
Here are the models that you entered into the competition.
... and so now, ladies and gentlemen, it's time for judging...

- Download and run every model for your class (you must look at all of them).
- Enter your choice for the 1st and 2nd award winners in this form.
- Judging is anonymous
- You cannot vote for yourself
- Note: some models may have difficulty in ending -- you can always terminate an animation using the menu item:  Tools/Halt

- Feel free to look at models from other classes, but you may not judge them
- Show some of your favorite models to your parents, siblings, grandparents...
Randomness Here's a model to download and fill in the code in class.
Patches! on Wed/Thurs.
Patches homework due:
Fri, 12/4 8:00a (p3,4)
Mon 12/7 8:00 (p 8, 9, 10)
Watch the Patches video beforehand.
Here are some techniques for using the WHO property of turtles, as well as seeing a procedure with arguments

Here is the model -- using only PATCHES -- that you should duplicate (create a normal model (not web-model) and upload to the homework server).
Shape/locomotion assignment and class contest
Due:  Mon, Nov. 30 for p 3,4
Tue, Dec. 1 for p 8,9,10
The instructions for the Entity Locomotion Project
Breakout rooms selection:
Selections need to be completed by:
Tues, 11/24 8:00a (for periods 3,4)
Wed, 11/25 8:00a (for peiods 8,9,10)
Until now, Zoom has decided who you'll share a breakout room with.
You're now going to be able to choose (to some extent) which people you'll be sharing a breakout room with, at least for the near future.  On Fri 11/20 (for periods 3,4) and on Mon 11/23 (for periods 8,9,10), I will show you how to sign up for a particular breakout room with your friends (or enemies). I will send you an invitation during your period to edit my Breakout Room Choice spreadsheet.
Homework using IF, IFELSE.  Due
Fri, 11/20/20, 8:00 for p 3,4
Mon, 11/23/20 8:00 for p 8,9,10
The homework is here -- download and take a look.  Then start from scratch on your own model.
More optional challenge homework. Animation exercises-1.  These are more challenging than before.  It's due (optionally) on Wed for p3,p4, and Thurs for p8,p9,10.  I Strongly recommend that y'all try at least some of it, because exercises 1 and 4 of the set are not that hard.
Homework for Monday, Nov. 16, 8:00a
(all periods)
This is an optional homework -- that means that this can replace an old (or future) homework that you didn't complete, or handed in very late, or had a bad hair day and the homework showed it.  And if you don't need that makeup, then you probably will like the challenge, so do it anyway.

Draw polygons and circles (and circle arcs): download and duplicate this model.
If you have trouble, review the trigonometric video solution for drawing pentagons below...(although the trigonometric solution for this model is different but similar to the one in the video).
Do at home for Wed/Thurs/Fri, Nov. 11 - 13 1. Draw the regular pentagon that's centered on the screen, with the user's preferred side-length and color.  Here is a video: Pentagon-howto.mp4 to solve the geometry problem in this task.
2. Look at the Netlogo cribsheet -- get used to using it as a reference (also, look at and be curious about the commands we haven't learned yet)
3. Watch the Netlogo videos 6 & 7.
Netlogo homework #2 -- Drawing
Due 11/10/20 8:00a for periods 3,4
Due 11/12/20 8:00a for periods 8,9,10
Download this drawing model  by right-clicking on the link, and choosing "Save link as..." (or equivalent) and saving it in a place that you will remember. 
Then, bring up Netlogo, and use the File/Open menu item to load that file.
Try each of the buttons to see what it draws.
Look at the Info tab for further instructions.
Create a model from scratch just like mine -- at least for the first 3 buttons.
The "Man/Woman" drawing is an optional challenge.
Save your model.  When saving any Netlogo model, make sure that the suffix of filename is .nlogo, for instance harry.nlogo or voldemort.nlogo, etc.
Upload the to the homework server's "Drawing" homework slot.
Add any comments about your experience or problems into the Comments-to-Teacher.

...and watch the NetLogo videos (and do the exercises) up to and including 5B (Buttons).
Fri/Mon classwork Draw this:
Day 2 of NetLogo.  Homework is...
Due 11/6/20 for periods 3,4
Due 11/9/20 for periods 8,9,10
1. Paste your Netlogo notes into the Comments-to-Teacher.  If, however, you've been taking notes by hand (how 20th century!), take a picture, and upload that picture as a file to the homework server slot.
2. Watch the Netlogo videos up to and including Video 3B.  DO THE EXERCISES along the way.

NetLogo Videos:   http://bert.stuy.edu/pbrooks/videos/NetlogoTutorial/NetlogoTutorial.py
The NetLogo videos (which took me 4 -5 weeks to produce back when I had a younger voice) were designed for 2 different purposes:
a) They are useful study tools.  You can go back to any material that you may have skipped because you were absent in class (hmmm, how can you be absent in class?) or had zoned out during a session.
b) You can move ahead now to interesting material we will cover in class later.
Netlogo! Download and install Netlogo from here: https://ccl.northwestern.edu/netlogo/
Choose the latest version, and no, you do not have to enter your name and email to do so.
After installation, launch the Netlogo program for the first time (not the Netlogo3D version, which you will also have).  It should look like this.
Malware and tracking Here's information about both.  Take this test, what does it reveal?
Malware and fingerprinting.
Criticism of criticism
Due 10/29/20 for periods 3,4
Due 10/30/20 for periods 8,9,10
Here is an algorithm you might be able to use to change your grade on the Scheme-test-test.
Working with files and folders

Tell me whether you succeeded or had trouble, with comments on the homework server.  Due the morning of our next meeting.
Here's a little adventure in testing your ability to work with files and folders on your hard drive (copying, moving, reading, deleting files/folders)...

Before you start, you'll need to know
1. how to create a folder(directory) with a particular name on your hard drive (anywhere you want)
2. how to download a .ZIP file
3. how to unpack (unzip) the .ZIP file's contents into the directory that you created.
4. how to read the contents of a particular file in that directory.

So... ready?

Start here: http://bert.stuy.edu/pbrooks/IntroResources/FilesDirsExercise/FilesDirsExercise.html
Homework on understanding the Internet:  Due morning of next meeting (8:00am). Here it is.
Hardware and software
Homework due 8:00a
(P3 & P4): 10/21
(P8, P9, P10): 10/22
Here's the first assignment for this section of the course: Understand and define some of the jargon terms used about computers and software.
In-class problems for Tues/Wed (10/13,14) These are soemwhat  more challenging Scheme functions, and you'll be cooperating in breakout rooms to do them.
Make a Scheme test:
Due Thurs, 10/15, 8:00am
This is the test for our Scheme unit.  Here are the instructions.
Scheme homework #3
Due:
(periods 3,4): Thur, 10/8
(periods 8,9,10): Fri, 10/9
Here's the homework mostly on decision-making with the IF construct.
Decision-making in Scheme using IF Here's the documentation on the pieces needed to make decisions: Boolean datatype (true, false), the 5 comparison operators (<, <=, =, >=, >), the 3 logical conjunctions (and, or, not), and finally, the IF contstruct itself:  The first two pages are material we've already covered...
Scheme homework #2
Due 8:00am of
(periods 3,4): Fri, 10/2
(periods 8,9,10): Mon, 10/5
Here's the homework.  A little more challenging. I may add more to it later.  So, create a new "program" in WeScheme that will save your results that you can come back to.
Scheme Resources Scheme documentation: Not everything in this document will be covered in this course this year. So, don't panic (yet).

Scheme review of what we've covered so far.

WeScheme:  web-based Scheme interpreter

DrRacket: Downloadable app with multiple versions of Scheme (choose the language: R5RS)

SchemingBat: This is a Scheme exercise site.
1st Scheme Homework
Due 8:00am of
(periods 3,4): Fri, 9/25
(periods 8,9,10) Tues, 9/29
Here's a quick review of short Scheme expressions.
Here's the homework.  Copy the expressions from the "definitions" pane (left-hand pane) of WeScheme into the Comments-to-Teacher portion of the homework server for this homework.
Intro to Scheme
Homework.
We'll be using WeScheme (https://www.wescheme.org/), a web-based version of the Scheme language. 
Homework:
1. Create an account at this website, using your stuy.edu address.
2. In the right-hand pane, try each of the 4 arithmetic operators (+ - * /) to make sure that Scheme works as expected.
Rocket.chat
Homework due:
Periods 3,4: Tues midnight
Period 8,9,10: Wed. midnight
To log in (once you've previously registered): https://introcs-pbrooks.stuycs.org/home
To register a new account on Rocket.chat, go to (this link good until end of Sun, 9/27): https://go.rocket.chat/invite?host=introcs-pbrooks.stuycs.org&path=invite%2FX6mW9B
You can use it inside your browser by just clicking on the link above.  Or you can download the app from the Rocket.chat site (https://rocket.chat/) and install it on your computer.  Then add our Rocket.chat server using the big "+" button on the left with the server: https://introcs-pbrooks.stuycs.org/
Homework:
1. Register with Rocket.chat. It will ask for both a "name" and a "username".  For username, use Firstname then Lastname (as in "Peter Brooks") because it's the username that everyone sees.
2. Once logged in, you'll see a circular ("world"-like) icon in the upper-left.  Click on that, showing all the channels.  Go to the "att-period-#" for your period.
2. Create an avatar (once logged in, click on your name icon (probably just a letter, and then "account")).  The avatar is your personal icon.
3. Add an entry to your period's "att" channel. It should include a greeting, and a suitable picture of yourself either as a human or animal (to upload a picture, click on the large "+" at the far right in the area that you would type a message, and choose a picture file on your computer).
First day survey due by Sun. midnight.  
Using Zoom Read a Zoom-setup document by Mr. Holmes.  Goal: use the Zoom app, rather than using Zoom in your browser (if possible), and log into Zoom with your (Google) stuy.edu account.
How to CompSci at Stuy This is a document that's been in the works by several CS teachers (Holmes, Genkina, Mykolyk) and their students for several years.  It is our best advice to you.  Read it all.
First task: fill out your Profile on the Homework server.
  1. Go to the main class link page (http://bert.stuy.edu/pbrooks)
  2. Click on the Homework/Grade server link (or use the one at the bottom of this webpage)
  3. Choose the Profile menu item
  4. Choose your period and name
  5. Log in with your OSIS number as your password
  6. Fill out your email address and preferred first name only, DO NOT CHANGE YOUR PASSWORD YET.
  7. Save: (press Change Profile button)...
  8. (optional, but recommended): now you should change your password for this Homework server:
  9.  Go back to the Profile page, create a password and press the Change Password button.
  10. REMEMBER this password!
Help from Mr. Brooks Feel free to come to the class Rocket.chat channel: #office-hours during office hours or make an appointment with me by email.

Office Hours Zoom (sometimes) -- preferably, send me email beforehand if you will want to Zoom-talk...  I will also be on the Rocket.chat channel: office-hours
 
https://us02web.zoom.us/j/81151131539?pwd=Y0JuVWpGYXlyQnBrVFg4dzJUWFFXdz09 
Meeting ID: 811 5113 1539
Passcode: 235232
Sending email to Mr. Brooks:
Send mail to: pbrooks@stuy.edu

You MUST include your name in the subject line or body of the message, otherwise I won't know who it's from.
Stuyvesant bell schedule  
Homework/grade server  
Mr. Brooks MicroMind, Inc.
Support Wikipedia