Lecture Materials

Questions & Answers


Q: Will Juliette acknowledge our email about the participation in design challenge to confirm that our entry has been submitted?

A1:  we can let you know :)


Q: ah omg juliette is giving lecture <3

A1:  yay!!


Q: Are there any good CS class to take in conjuncture with 106B that are on the CS track or do most of them require 106B as a prereq?

A1:  CS106B is a prereq to many other classes, so generally it's a good idea to take it before going on to other classes.


Q: Just wondering, the diagostics is the curve set at the medium? Or does it depend on the specific exam?

A1:  There is a curve set for the overall class grade (including assignments, diagnostics, and participation). We don't assign letter grades for each diagnostic individually.


Q: does list comprehension return a new list?

A1:  yes!


Q: how “good” at CS do you have to be to be a section leader?

A1:  its a combination of being proficient in the material, and good at explaining concepts! You can apply when you are in cs106b. The application process comes with feedback and you can always apply multiple times

A2:  You need to be solid on the material, but (perhaps more importantly) you need to be good at communicating those concepts to others.


Q: do you have to be a CS major to be a section leader and/or head TA down the line? thanks!

A1:  Nope. We have plenty of section leaders who are not CS majors.


Q: What language is microsoft excel written in ?

A1:  Well, back in 1991, it was written in C and C++. I was actually an intern at Microsoft working on Excel then... Yes, I'm old.

A2:  Its largely written in C and C++. Thats the language you will learn in cs106b, and also the language that python is written in :)


Q: is list comprehension more effiicient with respect to memory as well? Or is it more related to style, making code human readable, using less lines of code, etc.?

A1:  its mostly style. It can be slliiiightly faster, but mostly you should be thinking about readability


Q: juliette is a natural teacher :D

A1:  truly :)


Q: can we have if statements in list comprehensions?

A1:  it is possible — but i would caution you that eventually the list comp. becomes so complex that you would be better writing it in multiple lines (as a standard for loop)


Q: cheering on juliette as well! yay list comprehension!

A1:  Wahoo :D


Q: what does being a section leader offer?

A1:  Money and fame! Im mostly joking, but it does pay. I think the best thing you get is the learning experience of teaching. Its an amazing way to hone communication and content skills.

A2:  You get great teaching experience. You get to know other section leaders and course instructors. You learn the material even more deeply. And you get paid. Who could want more?!?


Q: is Juliette in France right now?

A1:  No.


Q: what do you need to do to become a section leader?

A1:  You need to take CS106B, be solid on the material, and be good at communicating that information to others. It's a great experience. We'd recommend it!!


Q: Are there interviews after we apply to be section leader? How do we demonstrate our ability to communicate what we understand while takingt the course?

A1:  Yes, there is an interview process where you also provide a sample of teaching.


Q: Is list comprehension more or less readable? this seems neat but can people be more confused by the long line? how do we choose which to use?

A1:  its a good question. I like them when they are nice and clean like Juliette is showing you. But you will see them in other folks code so its useful to know


Q: What is the typical hours / week commitment of section leading? Do you also get course credit?

A1:  It's generally 10-15 hours per week. The first quarter you do it, you could course credit (you enroll in a class about teaching called CS198). In sunsequent quarters, you don't get credit, but you get paid.


Q: how much does it pay to be section leader and how many hrs per week is the commitment?

A1:  It's 10-15 hours per week. The pay rate depends on your seniority (pay goes up the longer you section lead).


Q: Dont we need to lowercase the str beforw we compare to ‘y’ only ?

A1:  Assumption here is that the last letter of a name is always lowercase.


Q: Is the main reason that Python is considered very slow when compared to like C/C++ due to it being compiled at runtime? I also heard that it is only makes use of single threads so I guess that could contribute to it also?

A1:  those are all correct reasons. One final thing is that in python even numbers are stored using “references” where in C++ and Java, integers and floats are stored directly next to the variable name

A2:  Python is slower (mostly) because it is interpretter rather than compiled. C and C++ are compiled. C/C++ are also a bit "lower level" than Python, which allows for some things to be written to execute more quickly.


Q: who works in LAIR? are they section leaders?

A1:  yes!


Q: Can the conditions be framed in helper function? If so, can you use helper function in list comprehension when you have multiple conditions?

A1:  yes!


Q: If we have a specific question about debugging our code for assignment 7, is making a private post on ed an appropriate way to get help?

A1:  it can be! Also the lair is a great option


Q: Just wondering, if we wanted to work for X company , hypothetically would we have to be proficient in the programming language that the company uses, or do most companies use different languages depending on what the programmer is most comfortable with?

A1:  soon you will know all the languages. Learning new ones is not very hard once you know how to program (about a day?). When you join a company you often write code in the language the company uses


Q: Juliette is killing this lecture

A1:  Yes!! She's awesome!

A2:  True story!


Q: who is on the interview pannel for section leader job? And how many interviews are involved?

A1:  The coordinators of the section leading program and senior section leaders do the interviews. There are usually a few components of the interview process.

A2:  the section leader “corrdinators” (see the end of this page https://cs198.stanford.edu/cs198/Apply.aspx)


Q: Is there a list of computers (& specs) the CS department recommends we buy if we’re planning to take more CS courses? Thank you!

A1:  No, we don't have specific recommendations. In courses beyond CS106B, you are often just using your computer as a terminal to login in to other machines (often running linux) that you use to write/run your code.


Q: can you also build dictionaries using comprehensions?

A1:  you can!


Q: Does C++ also support notebooks too?

A1:  no it doesn’t (or not that I have ever heard of)

A2:  There are ways to do it, but it involves doing some involved configuration.


Q: other than CS106/A/B do any other CS courses offer job for teaching similar to section leading thats not TA?

A1:  i dont believe so — but there is a community service version of cs106a that also takes section leaders


Q: How do you determine which language to program with for a specfic task? Essentially, how do you balance readablility (Python, high-level languages) with speed and memory-optimization (C/Java lower-level languages). Is there an ongoing debate within the CS community on which aspect should be weighted more heavily?

A1:  its good to know both, then chose your language based on your task. There is no “one right language” and rather the right language for your task. Another important factor is the libraries that exist for a language (python has a library for everything!)

A2:  This depends a lot of the particular specifications of what you are trying to build. Reasonable people can also differ on the choice.


Q: Other than LaIR is there any other drop-in tutoring center at Stanord for CS major that we can go to?

A1:  LaIR and office hours are the main options for drop-in tutoring. CTL has tutors that you can schedule.


Q: I’d retake CS106A if Juliette became a regular teacher

A1:  haha me too


Q: how did Juliette run jupyter?

A1:  Here is a full description! https://jupyter-notebook-beginner-guide.readthedocs.io/en/latest/execute.html


Q: can you import files that you make (for example a class) into a jupyter notebook if you have it in your folder

A1:  Yes, you can import files/modules.


Q: Can you share in the chat the command to install jupyter notebook?

A1:  https://jupyter-notebook-beginner-guide.readthedocs.io/en/latest/install.html


Q: what is juyper again? Is it a server like what Chris showed us last time?

A1:  it is a server! A special server which runs this wonderful interactive python UI


Q: Do you press enter to run in Jupyter Notebook? Or is Juliette pressing some other key?

A1:  yes you can use keyboard shortcuts to run different lines


Q: If I were to minor in education, would becoming a TA be a good idea?

A1:  yes!!!


Q: when is that we use Jupyter vs. PyCharm?

A1:  thats a very personal choice! Jupyter is great for explorations, pycharm is great for making full programs


Q: Do we need to use tuples for assignment 7?

A1:  You dont need to, but you can use them if you want!


Q: what does state_counts.items( ) do?

A1:  it returns all the elements in the dictionary as a list of key/value pairs


Q: What programming language do Chris and Mehran use for their own projects/research?

A1:  I often use a combination of python / C++ / javascript. I use python for machine learning research and for building servers. I use C++ when I need something to be crazy fast or if Im doing 3D graphics. I use javascript for making web apps!

A2:  Depends on the project. Java and Python are pretty common for me these days. A few years back I spent a lot of time with C/C++.


Q: what does key param do in sorted() function?

A1:  it says, what is the thing you are sorting on


Q: So people do scratch work in Jupyter nb and then paste the code they want into Pycharm?

A1:  that happens a lot!


Q: How do we calculate IDF for a query?

A1:  There are two approaches. One is to use the same IDF values that are computed from the set of documents that are indexed. The other is just not to use IDF for the query -- just use the TF values.


Q: Are there any programming languages that are easy to learn once you know Python (like, maybe could learn on our own?)

A1:  The easiest ones to learn next are Java and C++! There is also a ton of learning resources online for JavaScript — but watch out. Even though javascript has a nice and beautiful core, there is some terrible (style) javascript code out there on the internet

A2:  It really depends, but one you know concepts like variables, functions, loops, if/else, etc, you'll see those concepts in many languages.


Q: is the Python we learn in this class enough programming exp for CS229 ML?

A1:  yes — its just a really fast paced class so more practice might be helpful


Q: Do the languages you teach change based on what language is popular?

A1:  yes, but we think about the future a lot (what will be popular in the future) and of course its whats most useful for Stanford students — which is sometimes different than what you might say is popular world wide

A2:  Somewhat. It's a combination of what's commonly used and what we think would work well for teaching.


Q: would Mehran hold his regular group/individual OH this Wed?

A1:  Yes.


Q: How to we install matplotlib?

A1:  using pip just like how you installed all the libraries (python3 -m pip install matplotlib)


Q: what CS course goes more indepth into data science that we can take?

A1:  CS109! It's a rockin' good time.

A2:  cs109!


Q: whenever we’re typing in pip install a module on our terminal, where is the code pulled from? who stores all these Python modules? if we want to make one, where do we upload it so people can download it through their terminal?

A1:  You need to register packages with PyPi, which is where the packages are stored for download.


Q: will juliette share the link to her jupyter notebook on the course website?

A1:  ill happily pass this request on to her!


Q: Will there be socially distanced in-person office hours with Chirs or Mehran come winter quarter.

A1:  Probably not.

A2:  i think we are still not allowed in our offices


Q: can we also import this library in PyCharm and use this same code?

A1:  you can!


Q: What is the advantage to Jupyter Notebooks comapred to doing this in PyCharm?

A1:  it has this nice property where your data sticks around as a variable


Q: Juliette, what are you planning to do after school?

A1:  Still tyring to figure this out :)


Q: thank you juliette ~ you’re the best!!

A1:  :)


Q: Will you follow in Mehran and Chris’ footsteps and become a CS106A lecturer?

A1:  live answered


Q: Teach 106A

A1:  live answered


Q: Could you go back to the command to download matplotlib and jupyter

A1:  Check out the slides!


Q: do you have suggestions for CS courses / guided projects I can do over break? I’m terrible at doing things on my own, and it helps a lot to have some structure

A1:  https://www.kaggle.com/ check it out!


Q: You guys should do code in place again! I know a lot of people who would love to participate

A1:  live answered


Q: Chris can we have a Simba update??!

A1:  live answered


Q: can you upload the entire Jupyter code you showed on the website?

A1:  live answered


Q: Can we submit our assignment or contest in a jupytr notebook?!

A1:  You can use jupytr to explore, but then turn your program into a runnable file in pycharm


Q: juliette, what CS classes did you like the most?

A1:  live answered


Q: is there lectture next week?

A1:  Yes, on Monday and Wednesday. Not on Friday.


Q: Can we apply to section lead in code in place?

A1:  Yes !! Please do. Students would be so lucky to have you


Q: Mehran, have you watched the last episode of The Mandalorian?

A1:  Not yet. That's the plan for tonight.


Q: are all CS classes as much fun or do they become more bland as we take higher classes?

A1:  live answered


Q: Mehran taught Chris, Chris taught Juliette, and now Juliette is teaching us. One of us is going to join you three in future:)

A1:  We hope so!


Q: What’s a good cs class if we’re interested in biocomp/BMC?

A1:  CS279


Q: How do you take notes for CS classes?

A1:  I try to absorb during class and look back at the slides after.


Q: wednesday is the last lecture?? 🥺🥺

A1:  Yup.


Q: is there no class on friday?

A1:  No class next friday !!


Q: Chris / Mehran what other courses do you teach?

A1:  This year, I'm also teaching CS182, and Chris is teaching CS109.

A2:  mehran is teaching an ethics class next and I am teaching probability (wahoo)


Q: is there any computer language that is more relevant than others for data processing these days?

A1:  Python is pretty popular for data processing, but there are other choices as well. Depends on the application.


Q: who is teaching Mon and Wed?

A1:  We all are.


Q: how was juliette able to run parts of her code through jupyter? was it through a jupyter notebook website?

A1:  It is a file running on my computer but it runs in the browser. It is like what Chris showed in lecture on Wednesday.


Q: is Juliette going to be head TA again? Is this teaching team going to teach CS106A together again?

A1:  Yes! But different professor for CS106A


Q: will the CS 106A website (resources, practice problems) continue to be available to us after the quarter ends?

A1:  Here is a permanent website url http://web.stanford.edu/class/archive/cs/cs106a/cs106a.1212/


Q: Is Juliette an undergrad?

A1:  Yes


Q: Is there an archive of the class website for our quarter?

A1:  http://web.stanford.edu/class/archive/cs/cs106a/cs106a.1212/


Q: What iterables are list comprehensions limited to

A1:  tuples, lists, strings


Q: How can I eventually find some CS work / internship experience if I am interested but my only experience is 106A?

A1:  live answered


Q: what’s the difference between CS181 and CS182?

A1:  live answered


Q: Do you guys ever watch Computerphile on YouTube?

A1:  oh yea! I watch a lot of numberphile (I suppose I have seen a lot of the computerphile content in other places)


Q: is AI gonna take over? if so, will you guys save us?

A1:  live answered


Q: what was the name of website Chris mentioned for more practice?

A1:  Kaggle has a list of datasets that you can download and analyze yourself.


Q: Can we get research positions as an undergrad in the CS department if so how competitve is it?

A1:  live answered


Q: How can we break the cycle of not having enough CS work experience to get work experience?

A1:  live answered


Q: Is it better to apply R or Python for data science?

A1:  live answered

A2:  Chris is a big fan of Python


Q: Actually the safest place to go is Antartica, a little cold there though lol

A1:  live answered