CS61B application

Describe your teaching experience.

This might include previous experience from any of the positions above or from taking CS 370: Introduction to Teaching CS. Feel free to copy from your official application and elaborate as much as you want. If you have a teaching experience that might differentiate your application, include it here. Please list in order of most recent to least.

  • I was involved with CSM 70 for three semesters, including one semester as a Junior Mentor, one as a Senior Mentor, and one as Co-coordinator. (Fall 2018 - Spring 2019)
  • I co-taught a CS70 CS Scholars section in Spring 2019.
  • I was a reader for CS170 in Spring 2019.
  • I was an academic intern / lab assistant for Data 100 in Fall 2018.
  • I was an academic intern for CS 61A in Spring 2018.

Why do you want to teach CS 61B?

I want to teach CS61B because it’s the class that cemented my decision to become a CS major, and was the reason I started working on side projects as a hobby and later a passion. It was the first class that made me realize how powerful software engineers truly are, and the impact we can have on the world. I’d like to share those insights with my students, and help them learn what being a CS major is all about. I’ve also been involved with teaching math-y related courses for 3 semesters now, so I’d like to try something different.

What makes you a good computer science teacher?

I’m proud of two main aspects of how I teach computer science. First, I emphasize teaching intuition very highly, over (almost) everything else. Since I’ve relied heavily on intuition for most of my academic success, I understand how valuable it is for students to gain intuition the first couple times they learn about a topic, and how it gets harder and harder if/when students develop a mental block. Therefore, I’m usually willing to sacrifice going through the entire worksheet if it means that I can cover the topics I’ve chosen clearly, thoughtfully and hopefully intuitively. Second, I try very hard to be as personable as I can for my students. Everyone has things that they’re good at in terms of social interaction—for me, I’m interested in a lot of different things, so I’m pretty good at holding conversations with different kinds of people, and I have a good memory, so I can remember the stories people tell me and follow up about them later. I use both of these traits to my advantage with my students, and try to ensure they feel comfortable enough with me to let their guard down.

What do you think is the biggest barrier to student achievement in CS 61B?

I think the answer to this question is one that (somewhat surprisingly) does not vary depending on the professor teaching the course — stress. Whether it’s cheating on assignments, over preparing but ultimately underperforming on exams, or generally just being miserable while taking the course, I think stress is the biggest barrier to achievement in 61B. I understand that the workload that students take upon themselves, and the academic implications of the class, are not under course staff’s control. However (not claiming to have concrete answers) I think there’s a lot of work still to be done in alleviating and preventing students’ mental health problems on a course-wide level.

Is there any individual who can speak to your teaching experience? If so, how have you worked with them in the past?

I think Professor Chris Hunn can speak to both my teaching expertise and dedication in a position of leadership. As CSM 70 co-coord, I worked closely with him in resolving a point of friction that developed at one point during the semester with the professors of the course. He saw first-hand how my co-coord and I worked tirelessly over a number of weeks to correct the situation, developed sweeping changes in course content in line with the professors’ requests, and ultimately reached an effective compromise that has paved the way for much better interaction between CSM and course staff in the future.

He also hired me as a tutor for CS70 CS Scholars. While he wasn’t too involved in my teaching, he occasionally dropped in to observe how section was going. He told me that he received positive feedback from students, which I’m sure he could speak to as well.

If you’ve created any teaching material on the web, provide a link.

Here’s one of the worksheets I created with CSM 70 as a supplement for my students, a write-up about random variables: https://www.dropbox.com/s/4a2p1nqrn6vszng/random_variables_writeup.pdf?dl=0


uid: 202005111503 cs61b application date: May 11, 2020 tags: #applications

February 22, 2023

Useful Mac OS X Keyboard Shortcuts

==Obviously a non-exhaustive list.==

Key: : Command : Shift : Option ^: Control

 Important System Shortcuts/Guestures

Shortcuts

Shortcut Action
⌘Q Quit an application
⌘Tab Cycle through all open applications
⌘` Cycle through open windows of a single application
⌥Space Open Alfred
⌥⇧C Open Alfred clipboard manager
⌘Z, ⌘C, ⌘X, ⌘P Undo, Copy, Cut, Paste
⌘N New window (usually)
⌘A Select All
⌘S Save
⌘, Go to Preferences (Settings page)
⌘→ / ⌘← Go to end of line/beginning of line
⌘↓ / ⌘↑ Go to end of file/beginning of file
⌥←/ ⌥→ Move back and forth through text, one word at a time

Gestures

Gesture Action
Swipe up with three fingers See all open windows across applications, scattered across the screen. Also see other desktops and full-screen applications
Swipe down with three fingers See all open windows for a given application
Swipe outward with four fingers See Desktop
Swipe left/right with three fingers Go to desktop/full-screen application open on the left/right

download Important Chrome Shortcuts

Shortcut Action
⌘L Go to Omnibar (main searchbar)
⌘T New tab
⌘W Close tab
⌘⇧T Re-open last closed tab
⌥W Cycle through previously opened tabs. Press ⌥W once to go to previously opened tab; press ⌥W twice quickly to go to the tab you opened before that, and so on.

download Important Alfred Shortcuts

Shortcut Action
Space, with an empty Alfred box Only search for files
, after highlighting a file Do specific actions on the file, such as open in email, copy, move file, etc.
olk from:{keyword} Outlook emails from someone
olk {keyword1} {keyword2} {keyword3} Search for one or multiple keywords
olk recent:today Just get today’s mail

download Important Outlook Shortcuts

Mail Shortcuts

Shortcut Action
⌘1 Go to Mail
⌘2 Go to Calendar
⌘3 Go to Contacts
⌘4 Go to Tasks
⌘5 Go to Notes
⌘⇧F Search Outlook
⌘R Reply
⌘⇧R Reply All
⌘J Forward
^[/ ^] Go back/forward through your list of emails
⌘E Add an attachment to the open email
Space Scroll down to the next screen of text or, if you are at the end of an email, display the next email
⇧Space Scroll up to the previous screen of text or, if you are at the beginning of an email, display the previous email
⌘N Create new email
⌘Enter Send the open email

Calendar Shortcuts

Shortcut Action
⌘N Create new appointment
⌘O Open the selected calendar event
Delete (backspace) Delete the selected calendar event
⌘T Switch the view to include today

uid: 202005091816 tags: #presentation

February 22, 2023

I’m an engineer at Stripe. I run Buttondown and Spoonbill. I love Python, cocktails, poetry, and you.

A gentle introduction to itertools

itertools is pretty much the coolest thing ever. Despite a vaguely technical name and a decreased emphasis in most introductory Python materials, it’s the kind of builtin package that makes list comprehensions much less of a syntactical mess.

The biggest barrier to using itertools is that there are, well, a lot of methods that tend to all do similar things. With that in mind, this post is a showcase of some of the more basic — yet completely rad — things you can do with these methods.

Setup and a Disclaimer

First, let’s get the boring part out of the way:

import itertools

letters = ['a', 'b', 'c', 'd', 'e', 'f']
booleans = [1, 0, 1, 0, 0, 1]
numbers = [23, 20, 44, 32, 7, 12]
decimals = [0.1, 0.7, 0.4, 0.4, 0.5]

Well, that was easy.

chain()

chain() does exactly what you’d expect it to do: give it a list of lists/tuples/iterables and it chains them together for you. Remember making links of paper with tape as a kid? This is that, but in Python.

Let’s try it out!

print itertools.chain(letters, booleans, decimals)

>>> <itertools.chain object at 0x2c7ff0>

Oh god what happened

Relax. The iter in itertools stands for iterable, which is hopefully a term you’ve run into before. Printing iterables in Python isn’t exactly the hardest thing in the world, since you just need to cast it to a list:

print list(itertools.chain(letters, booleans, decimals))

>>> ['a', 'b', 'c', 'd', 'e', 'f', 1, 0, 1, 0, 0, 1, 0.1, 0.7, 0.4, 0.4, 0.5]

Yay, much better! chain() also works, as you’d imagine, with lists/iterables of varying lengths:

print list(itertools.chain(letters, letters[3:]))

>>> ['a', 'b', 'c', 'd', 'e', 'f', 'd', 'e', 'f']

(For the purposes of making this a readable post I’ll be surrounding most of the methods with list() casts.)

count()

Let’s say you’re trying to do a sensitivity analysis of a super important business simulation. Your entire super important business simulation hinges on the hopes that the average cost of a widget is $10, but demand for that widget might explode over the new few months and you make sure you won’t hemorrhage money if it costs more money. So you want a list of theoretical widget costs to pass to magic_business_simulation().

With list comprehensions, that might look something like:

[(i * 0.25) + 10 for i in range(100)]

>>> [10.0, 10.25, 10.5, 10.75, ...]

Which isn’t bad at all! Except that reading it is difficult, especially if you’re chaining that list comprehension inside another list comprehension.

With itertools it looks like:

itertools.count(10, 0.25)

Whee! Now, if you’re a smart little Pythonista you might be thinking to yourself:

Well I pass the function a starting point and a step size, but how does it know when to stop?

And the answer is it never stops. count() and many other itertools methods generate infinitely, until aborted (via, say, break). No, really — again, itertools is all about iterables, and infinite iterables might be scary right now but they are incredibly helpful down the road.

So let’s say we only want the values of the above method up until $20 (this widget has very elastic demand, apparently). How do we cut off count() like a stern mother scolding a sugar-addled child?

(Hint: another itertools function.)

ifilter()

ifilter() is a simple invocation of a simple use case:

print list(itertools.ifilter(lambda x: x % 2, numbers))

>>> [23, 7]

Simple, right? You pass in a function and an iterable object: it returns a list of those objects which, when passed into the function, evaluate True.

So, to solve our little widget problem from earlier:

print list(itertools.ifilter(lambda x: x < 20, itertools.count(10, 0.25))

>>> ...

>>> ...

Yeah, this is still going to keep on going infinitely because count() will keep giving you values, and even though they’re going to be ignored by ifilter() it has to process them.

So how do we do this? A common pattern is thus:

for i in itertools.count(10, 0.25):
    if i < 20:
        do_something()
    else:
        break

(Look how readable that is. Isn’t that wonderful?)

compress()

compress() is by far what gets the most of my use. It’s perfect: given two lists a and b, return the elements of a for which the corresponding elements of b are True.

print list(itertools.compress(letters, booleans))

>>> ['a', 'c', 'f']

imap()

The final method I’m going to go over is one that should be a simple addition for readers well-versed in the functional programming staples of map and filter: imap() is just a version of map that produces an iterable. By passing it a function, it systematically grabs arguments and throws them at the function, returning the results:

print list(itertools.imap(mult, numbers, decimals))

> [2.2, 14.0, 17.6, 12.8, 3.5]

Or (perhaps even better), you can use None in lieu of a function and get the iterables grouped as tuples back!

print list(itertools.imap(None, numbers, decimals))

> [(22, 0.1), (20, 0.7), (44, 0.4), (32, 0.4), (7, 0.5)]

Okay, so now what?

These are, in my opinion, the five most helpful elements of itertools. But there are way more. Play around with the above five, then five more (permutation(), I’d argue, wins the award for highest fun-to-usefulness ratio). But the big takeaway is that these methods are cool on their own, but saving a few lines and characters by migrating away from list comprehensions is a benefit that pales in comparison to what you can do by combining these methods together.

The official documentation has a bunch of great examples of how powerful itertools is when you pair it with itertools. My favorite is below:

def unique_everseen(utterable, key=None):
"List unique elements, preserving order. Remember all elements ever seen."
# unique_everseen('AAAABBBCCDAABBB') --> A B C D
# unique_everseen('ABBCcAD', str.lower) --> A B C D
seen = set()
seen_add = seen.add
if key is None:
    for element in ifilterfalse(seen.__contains__, utterable):
        seen_add(element)
        yield element
else:
    for element in utterable:
        k = key(element)
        if k not in seen:
            seen_add(k)
            yield element

(Thanks to redditor bwalk for pointing out a typo!)

See also:: (Using pdb 202004231649 How to use pdb) for other Python references


uuid: 202004290009 date: Apr 29, 2020 tags: #python

February 22, 2023

downloaddownload

February 22, 2023

download-9075549download-9075549

February 22, 2023

download-9075290download-9075290

February 22, 2023