Instantly share code, notes, and snippets.

🎯
Focusing

# Yuxiao Wang sgrayrw

🎯
Focusing
Last active October 9, 2018 19:51

CS107 -- Exam 1 Practice

Here are some practice problems for the upcoming exam. These are somewhat representative, but won't be precisely what's on the exam: they exercise the same kinds of ideas.

I'll just do a quick dump of problems. I won't be giving a key right now, because my experience is that studnets don't work the questions but just look at the key if they have one. I am happy to check your answers if you write them up. I'll also comment on problems a bit tomorrow.

1. In git, briefly explain what a merge conflict is and how you might fix it. You do not need to
Last active October 10, 2018 03:29
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
 # Prove that the cost of this function is O(n) # # Prove that this function computes a result x' such that: # x' = x * (x+1) / 2 def e(x): if (x == 0): return 0 return: x + e(x - 1) # Prove that the return value of this function is a list l' such that: # forall i < len(l). l'[i] = 2 * l[i]
Created September 19, 2018 02:51
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
 def isEmpty(lst): return len(lst) == 0 def hd(lst): return lst[0] def tl(lst): return lst[1:] # Return the reverse of lst def reverse(lst): return [] # Find the minimum element of the list
Last active June 12, 2024 18:39
Use macOS-style shortcuts in Windows

# Use macOS-style shortcuts in Windows / keyboard mappings using a Mac keyboard on Windows

ℹ️ There is a newer alternative project that does similar things and more, check it out at https://github.com/stevenilsen123/mac-keyboard-behavior-in-windows

Make Windows PC's shortcut act like macOS (Mac OS X) (using AutoHotkey (ahk) script)

With this AutoHotKey script, you can use most macOS style shortcuts (eg, cmd+c, cmd+v, ...) on Windows with a standard PC keyboard.