Lecture 1: Introduction to Research — [📝Lecture Notebooks] [
Lecture 2: Introduction to Python — [📝Lecture Notebooks] [
Lecture 3: Introduction to NumPy — [📝Lecture Notebooks] [
Lecture 4: Introduction to pandas — [📝Lecture Notebooks] [
Lecture 5: Plotting Data — [📝Lecture Notebooks] [[
These are instructions for setting up git to authenticate with GitHub when you have 2-factor authentication set up. This authentication should be inherited by any GUI client you are using. These are intentionally brief instructions, with links to more detail in the appropriate places.
-
Download and install the git command-line client (if required).
-
Open the git bash window and introduce yourself to git (if required):
git config --global user.name 'Firstname Lastname' git config --global user.email '[email protected]'
This file contains hidden or 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
import PropTypes from 'prop-types'; | |
type Omit<T, K> = Pick<T, Exclude<keyof T, K>>; | |
type Defined<T> = T extends undefined ? never : T; | |
/** | |
* Get the type that represents the props with the defaultProps included. | |
* | |
* Alternatively, we could have done something like this: |
This file contains hidden or 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 greet(): | |
print("Hello World") | |
if __name__ == "__main__": | |
greet() |
This file contains hidden or 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
function coinSum(amount) { | |
return getCount([200, 100, 50, 20, 10, 5, 2, 1], amount); | |
} | |
const getCount = memoize((setOfCoins, value) => { | |
if (setOfCoins.length === 0 || value < 0) return 0; | |
if (value === 0) return 1; | |
var largestCoinInRemainingSet = setOfCoins.slice(0,1); | |
var remainingCoins = setOfCoins.slice(1); |
This file contains hidden or 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
function buildObject(str) { | |
var newObj = {}; | |
var contents = str.substring(1, str.length-1).split(","); | |
if (!contents[0]) return newObj; | |
contents.forEach(function(keyValuePair) { | |
var keyAndValue = keyValuePair.split(":"); | |
var key = keyAndValue[0]; | |
var value = keyAndValue[1]; | |
newObj[key] = parse(value); // parse is a helper function |
This file contains hidden or 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
function buildObject(str) { | |
var newObj = {}; | |
var newKey, newVal; | |
var elstart = 1; | |
var elend = 1; | |
var contentsStr = str.substring(1,str.length-1); | |
contentsStr = contentsStr.trim(); | |
var contentsLength = contentsStr.length; | |
if (contentsLength === 0) { |
This file contains hidden or 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
function buildObject(str) { | |
var newObj = {}; | |
var newKey, newVal; | |
var elstart = 1; | |
var elend = 1; | |
var contentsStr = str.substring(1,str.length-1); | |
contentsStr = contentsStr.trim(); | |
var contentsLength = contentsStr.length; | |
if (contentsLength === 0) { |
This file contains hidden or 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
function buildObject(str) { | |
var newObj = {}; | |
var newKey, newVal; | |
var elstart = 1; | |
var elend = 1; | |
var contentsStr = str.substring(1,str.length-1); | |
contentsStr = contentsStr.trim(); | |
var contentsLength = contentsStr.length; | |
if (contentsLength === 0) { |
This file contains hidden or 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
function Parent(name) { | |
var obj = Object.create(parentProto); | |
obj.name = name; | |
return obj | |
} | |
var parentProto = { | |
greet: function() { | |
console.log("hi, I'm " + this.name); | |
} | |
}; |
NewerOlder