Lecture Materials

Questions & Answers


Q: what all do we submit for part 2b/2c on the homework?

A1:  image-grid.py, bluescreen.py, bluescreen image that you created


Q: I am having issues with the assignment code. I mentioned it on Ed. When can I expect a response?

A1:  We will get back to you on Ed, come to LaIR tonight also


Q: So just Tuesday-Thursday this week?

A1:  Yes, but you have the first quiz on Friday at 1:30pm!


Q: How do we submit the py files do we have to save as separate files?

A1:  Nope but make sure you hit save on Pycharm. Then to submit, go to paperless and submit the .py files that you modified.


Q: hey! i was just wondering when we are starting IGs because I dont think my section leader has talked about them yet

A1:  We are going to have IGs for assignment 1. IGs are just starting because we are finishing grading the assignments. Feel free to email your SL to ask about their IG timeline.


Q: I was out of town and had forgotten my charger is it ok to turn in the assignment a day late?

A1:  All assignments have a 48hr grace period where you can submit the assignment without penalty :) If you need to submit after the grace period, please reach out to the head TA Tara.


Q: homework is due today, but we can still get full credit until thursday right?

A1:  Yes! All assignment have a 48hr grace period unless stated otherwise


Q: When are the IG session sign-ups for the first assignment going to be announced (if you know about the second assignment as well, that would be great).

A1:  IGs should be starting soon! We are having IGs for the first assignment. We haven’t decided about the second assignment yet. Feel free to email your SL to ask about their IG timeline.


Q: about how many questions will be on the quiz?

A1:  We cannot say


Q: Is there a specific thing we have to take a picture of for the bluescreen part of the homework?

A1:  No you get to be creative :)


Q: Will the quiz automatically submit at the end of the time? I have testing accomadations that I'm working though with the OAE.

A1:  It will start submitting at the end of time but submitting takes a bit of time (you have to use duo push etc).


Q: does bit work in pycharm?

A1:  Karel (another version of bit) does work in Pycharm. I don’t believe that bit does.


Q: For the bluescreen (part c), do we need to have multiple tests (meaning using different base photos say one space monkey and one Yotter) with different backgrounds and submit it or do we just need to make sure our code works with just one of our photos (like just the space monkey)?

A1:  It’s always a good idea to run all tests available


Q: Does the review hand out have more questions than the actual quiz will?

A1:  Yes! For example, we released over 10 bit problems but there will not be 10 bit problems. The quiz is timed and usually around 30 minutes (although the exact amount of time given is still to be determined).


Q: Will we be able to have the references for bit and images?

A1:  Yes! The quiz is open note and open internet. You can use all resources. As always, the honor code applies so no copying code from the internet


Q: What are IG slots

A1:  An IG slot is a time to meet with your SL to go over your assignment. Usually several different times will be available


Q: Do we need to comment this second hw?

A1:  Yes! Always comment your code :)


Q: How will we take the quiz? Is there a link for it?

A1:  Instructions will be posted on the class website but you will be taking it in a software called Bluebook. You should download Bluebook BEFORE taking the quiz. Instructions here: https://web.stanford.edu/class/cs106a-8/handouts_w2021/bluebook_info.html


Q: Will we be able to autocorrect/autofill code on the quiz?

A1:  No. It’s almost like coding in a text editor (like Google docs without autocorrect)


Q: is there a lockdown browser?

A1:  No, but you cannot copy and pasted into or out of Bluebook.


Q: How do I know if I submitted my Pycharm HW correctly?

A1:  You can check your submission on paperless by clicking your assignment :)


Q: Do we join this zoom meeting on Friday?

A1:  No, you will take the quiz “asynchronously”. You have to take it duing the time slot (unless you have accomodatations from Tara) but you don’t have to join a Zoom


Q: do we need to start precisely at 1:30?

A1:  Usually there’s a few minute buffer (i.e. the quiz will be available from 1:30-2:30pm but the quiz is 45 minutes long). I recommend starting as close to 1:30pm as possible though because the exact quiz length has not been announced.


Q: I have opted for another time. Will the announcement be out ending Thursday?

A1:  Can you expand on your question?


Q: Is BlueBook more similar to the experimental server or pycharm?

A1:  It’s not really like either. It’s more like a Google doc. There’s no formatting, autochecker and you cannot copy and paste into or out of Bluebook.


Q: Are we suppose to write code in the part c of the assignment?

A1:  You’re using the monkey/moon code. You may have to modify your code slightly to create the best image.


Q: Is there still section this Friday?

A1:  Yes! Let me follow up with Tara about the 1pm section time


Q: I looked at the quiz 1 review materials earlier today. Sounds like it is mostly bit with some images. Is that correct? Any other major concepts we need to review such as blue screen or grids?

A1:  The review material is a great prep for the quiz. I believe grids are not on quiz 1 but let me ask Juliette at the end


Q: should the code we write on the quiz have comments?

A1:  Style is not graded on the quiz so comments are not necessary


Q: To clarify about the space and Yotter question I have a photo I took of different stuffed animals and was wondering if I just need to test with 1 of them opposed to two :)

A1:  mmm can you clarify your question? For bluescreen you only need to submit 1 creative photo (but you can submit more if you’d like)


Q: How will Assignment 2c be graded?

A1:  Similarly to other programs, on functionality (did you submit, does it work?). There is also a contest for creativity (no bonus points just kudos)


Q: for the bluescreen problem, do we have to edit the code? Is it possible to just plug images into the code already provided?

A1:  You can plug in and then might need to modifiy your multipliers to get a better image.


Q: Hi! This question is about the last topic in images. How do you reference the value of n used for each run in the run menu. This was on the homework, and I only knew how to set the range as a set number of pixels vs a variable number of pixels. Thanks in advance :)

A1:  Great question! If you are using a for i in range() loop, i equals the number of iterations. I answered a question but maybe not yours so please follow up if you have more questions!


Q: Will the IG time we pick this week be the same for every time for IG's'? Or will we schedule each time independent from each other?

A1:  Each time is scheduled independently of the others. There is not a set IG time


Q: How much time should we take for each question on the quiz?

A1:  Usually the number of points for each question is a good indicator for the amount of time you should spend. Say you have a 30pt 30 min quiz. You should spend ~5 min on the 5pt question, ~10min on the 10pt question etc. Although this varies individual to individual


Q: how do we access the movie file

A1:  Download the starter code, open it in pycharm, and open the movie.py file


Q: I accidentally resubmitted the first hw assignment (it is the same version as what I submitted on time). Will I get a late penalty?

A1:  Great question! Can you email the head TA Tara to let her know?


Q: When working in pycharm do we need to save our code or does it autosave?

A1:  You should save your code! It’s autosaves but not very frequently. You can hit save in File on the top toolbar :)


Q: Should we write Doctests in the quiz?

A1:  No unless explicitly stated that you should.


Q: For the 2b homework (in pycharm), the terminal window always shows me an error when I try to run the "hello Alice" code. It says that it cannot locate the image-grid file. What should I do to solve this issue?

A1:  mmm I’m not sure what exactly is the issue based on this information. Can you post on Ed or swing by LaIR?


Q: What material should we know for the quiz in terms of lecture numbers (ie. from lecture 1 - lecture…) and does the review cover everything we should know?

A1:  Through lecture 7. The quiz review is a great resource!


Q: do you need to do grid.width() with parentheses or no?

A1:  No, just like in image pixel.red you do not need parentheses. Here’s a grid reference https://web.stanford.edu/class/cs106a/references/grid/grid-reference.html


Q: Could you explain what bound means?

A1:  Grids have bounds meaning that they have a set size. There are not negative grid spaces and you can index outside of the bounds (size) of the grid


Q: is it okay to just not use the 0th index and make a grid +1 size larger than needed and just use index 1 - n

A1:  Not using zero indexing would be difficult because the grids are designed to be zero indexed


Q: what exactly does ‘a’ stand for?

A1:  '‘a’ is a value in the grid. Grid squares can have any value


Q: How will we run code on BlueBook?

A1:  You cannot run your code in Bluebook. Running your code on the quiz is not recommended because you cannot copy/paste into or out of Bluebook. Also minor syntax errors are not going to be docked for


Q: Will the quiz be on content up to images or is there going to be grids?

A1:  Grids are not on this first quiz


Q: why is the 2nd grid in grid = Grid.build() capitalized?

A1:  Great question! Grid referes to the class Grid (creating a new Grid object; beyond the scope of this course). grid is the name we gave to our Grid variable/object. This is similar to the line bit = Bit(filename)


Q: what does ">>>" do in pycharm?

A1:  This indicates that you have a doctest and what code should be run in the doctest


Q: for the bluescreen problem, do we have to edit the code? Is it possible to just plug images into the code already provided?

A1:  It can be possible to not modify. Sometimes you need to update the constant to get a better image. Up to you.


Q: I will have a little problem turning in the hw this week, i have a lot of work. How bad is the penalization after thursday?

A1:  Sorry that you have so much work this week! Please reach out to the head TA Tara to see if you can submit after the grace period.


Q: Can you please explain grid.set

A1:  Great question! get.set sets a value in the grid at the location x,y. Grid squares can hold a value (or None if no value is indicated)


Q: Should we write comments on our code for assignment 2a?

A1:  Yes! You should always comment your code.


Q: What is the purpose of grid? I’m also a bit confused why she put in different values like a, b, a

A1:  Grids are like squares that are arranged in a rectangular shape. You can store values in each square and each square has an x,y location


Q: I have requested for a change in time for the quiz to a time in PST which is Thursday night. So for the announcement, will the announcement be out ending Thursday?

A1:  If you arranged with Tara to take the quiz at another time, she should provide you information to take the quiz. You can follow up with her via email :)


Q: my doctest fail came out without the expected: recieved: format

A1:  mmmm I’m not sure why that error would happen without seeing the code. You can post on Ed or swing by LaIR tonight to get help with that error :)


Q: Are doctests like scaffolding that we delete from the complete code at the end?

A1:  No, you should submit your doctests :)


Q: The quiz will cover how many lectures ?

A1:  Through lecture 7


Q: do computer generate a random number from the current time or getting where the mouse points which are quite random

A1:  live answered


Q: which lectures do we need to accomplish this weeks hw?

A1:  For images (assignment 2), you need to lecture 7


Q: Can we submit the bluescreen code today with only a few images for the on-time bonus, then take more images later to bring to our section to work with?

A1:  No, if you want the on-time bonus you have to submit by the on time deadline. You can still get full credit for 48hrs after the on time deadline


Q: Hi! Just wondering if you saw my question? How do you reference the value of n used for each run in the run menu. IE how do you set a variable number of pixels to match the run menu.

A1:  Hi! Yes, sorry we are getting so many questions today! If you want to see the value of n used each time in the terminal you can add a print statement i.e. print(n). Please follow up if you have another question!


Q: how do we get to the python console?

A1:  On the bottom toolbar in Pycharm (next to the terminal)


Q: What’s this python console part? How is that different than the terminal?

A1:  It’s more like the hack mode interpreter. You can just run Python code. The terminal is where you can run your programs or also Python code if you do the right command


Q: What are doctests?

A1:  They are a way to test if your code works how you want it to. You put in an input and tell the computer what the output should be. The computer will then tell you how the actual output compares to your anticipated output


Q: can ’n’ be a real a real number?

A1:  It depends on the context. Can you follow up with the line of code so I can give a thorough answer? If n is in a for loop, n must be a integer :)


Q: is the python console kind of like the hackmode interpreter?

A1:  Yes!


Q: Do we have to do doctests for the image homework? I'm assuming not since we weren't taught how to do doctests for images, or if those are even possible, but I figured I should ask to make sure.

A1:  No but you will for assignment 3 :)


Q: Do we need pre and post conditions for part a,b, and c for the homework due today or is normal comments for just a and b okay? I assume part c doesn’t need comments? :)

A1:  You can just do “normal” comments. Pre/Post conditions are great for Bit but not always needed post Bit.


Q: What MacOS is this?

A1:  I’m not sure. Let’s ask Juliette at the end :)


Q: do doctests exist in other programming languages as well? for example c++?

A1:  Testing exists in all languages even though they aren’t always called doctests :)


Q: Are doctests on the quiz on friday?

A1:  No but they will be on your next homework :)


Q: Hi.Just wondering if you saw my question.The quiz will cover how many lectures on this Friday ?

A1:  Yep! Getting though them as I can, the quiz will cover through lecture 7


Q: What is char?

A1:  Great question! Can you provide more context so I can provide a thourough answer? In general, char stands for a character which is a single string letter


Q: can we do the practice exam only once? or can we submit it several times?

A1:  I believe you can submit it multiple times. You cannot access your old submission after submitting though


Q: Just wondering if you can ask your section leader for coding help via zoom? With LAHr the time limit makes it hard to really dive into anything.

A1:  You can reach out to your SL for questions but it’s very hard to debug code over email. In addition to LaIR, you can also stop by Juliette or Tara’s office hours :)


Q: Is the practice examen graded?

A1:  No :)


Q: where can I find the review materials and the practice tests?

A1:  On the class website under handouts :)


Q: If our image works with the current code for 2c with minor tweaking (just for the number testing for blue) is that okay or should we change anything from the code you have provided us? And once we changed it to fit our photo the monkey’s blue pixels don’t look the same as before (there are more pixels from the blue blanket included). I was wondering if that’s okay? I wasn’t sure if our code should work with our photo and monkey.

A1:  Your image and the monkey image likely need different constants. You can change your constant to make your photo (since you submit your photo) and then change it back before submitting for the monkey settings. Great job finishing!

A2:  Juliette says to keep the constants good for your photo and not for Bluescreen. Sorry for the confusion!


Q: does this course get rid of the worst grade for final grading?

A1:  I believe no grades are getting dropped this quarter. I’ll confirm with Juliette at the end of lecture.


Q: i submitted 2c with the different constants (so that it works with my picture and it doesnt rl look good with the monkey one)… will this affect my grade?

A1:  Since you submit your blue screen image, you can change the constant back to the monkey constant. Can you resubmit with this?


Q: Is it possible to change my quiz time because of time zone issues?

A1:  Yes! Please reach out to head TA Tara via email ASAP!


Q: Hi! can you please go over how to save a pycharm file to our computer to upload it to paperless?

A1:  Pycharm autosaves (although I like to save myself File -> save). Then you drag the files into the submit box on paperless. You can view your submission on paperless by clicking on the file in paperless


Q: How do you import your own image into the bluescreen.py file instead of the example ones? Do you write your image name where is says (front_filename)?

A1:  Put it in the same folder (image-grid is the name of the folder) and then use your filename when you run the program from the terminal


Q: For the 2b homework (in pycharm), the terminal window always shows me an error when I try to run the "hello Alice" code. It says that it cannot locate the image-grid file. What should I do to solve this issue?

A1:  mmm I’m not sure what the error is based off this info. Can you stop by LaIR tonight?


Q: I’m a bit confused onn how to create a new project on pycharm without ann eexisting python folderr

A1:  Use the assignment download instead


Q: my pycharm does not show images when i doing my hw

A1:  mmm I’m not sure what exactly the issue is. Can you post on Ed or swing by LaIR?


Q: What do we need to change about 2c before we submit it? Isn’t it already coded correctly?

A1:  Only what you multiply average by to grab the correct pixels


Q: when I submitted my picture as a png image when i try to open it on paperless it says because it is not letter characters it cannot open the image, can you guys still see it?

A1:  Yes!


Q: when we submit our code for the image grid homework, will our section leader see the final correct image in addition to the code? otherwise, how do they know we got it correct?

A1:  We see the code and image :)


Q: For the bluescreen project, do we have to include our final image in the folder or should we submit it separately

A1:  Submit it together :)


Q: Adding on to this question: “i submitted 2c with the different constants (so that it works with my picture and it doesnt rl look good with the monkey one)… will this affect my grade?” if i change back to the monkey constant then there will be no difference between the code you gave us and mine

A1:  Submit the one that works for your code


Q: is there a way to resubmit on paperless?

A1:  Yes! You can submit as many times as you like :) We only grade the last submission


Q: are there going to be time or memory limits for future homeworks?

A1:  No


Q: Is there a way to set three RGB values for a pixel in one line (not pixel.red = ..., pixel.green = ...., etc)?

A1:  Unfortunately no


Q: How do we know if our image-grid code is correct if we do not have any test cases?

A1:  Compare it to the assignment handout


Q: Do we upload only the final image or the images we combined for the greenscreen?

A1:  Only the final image for BlueScreen


Q: the front and back jpgs seperately plus the final product?

A1:  Just the final product


Q: is the quiz only bit and images?

A1:  Bit, images, and blackbox functions using strings.


Q: can you do two different submissions for image grid and blue screen or does it have to be the same submission?

A1:  Same submission


Q: If there any way to change the height of your base photo so it appears a certain location in the bluescreen image?

A1:  Try doing some math with the coordinates


Q: Should we submit the entire folder or just the python files and our images

A1:  Just python files and images


Q: so how do you resubmit?

A1:  Just like how your submitted the first time. :)


Q: How do you import your own image into the bluescreen.py file instead of the example ones? Do you write your image name where is says (front_filename)?

A1:  You need to put your own image into the same folder (image-grid should be the name of the folder) and then when you run the program from the command line you give your file names.


Q: Does 2c need to work for the monkey images? I used a green background instead of a blue background and changed my code so it works for mine, and not the given ones.

A1:  Only needs to work for your final image.


Q: what if you submitted the homework but afterward you unintentionally resubmitted it after the deadline?

A1:  Please email the head TA Tara :)


Q: Sorry and when we submit part c you want us to change the constant back to work with monkey correct? Wanted to double check

A1:  No, keep the constant good for your photo. Sorry for the confusion!


Q: Do we upload the final image or both of the images we combined for the bluescreen?

A1:  Final image only


Q: for the blue screen homework, do we submit 1 or 2 images?

A1:  as many as you want


Q: will we get penalty if we handed in the homework on time but afterwards unintentionally resubmitted it

A1:  Please email head TA Tara and your section leader :)


Q: Do we submit parts B and C separately?

A1:  You submit everything together :)