Skip to content

Instantly share code, notes, and snippets.

const doctorWhoEpisodes = [
{"episode": "eleventh hour", "season": 5, "uk_ratings": 10.9, "doctor": 11, "writer": "moffat"},
{"episode": "blink", "season": 3, "uk_ratings": 6.62, "doctor": 10, "writer": "moffat"},
{"episode": "human nature", "season": 3, "uk_ratings": 7.74, "doctor": 10, "writer": "cornell"},
{"episode": "family of blood", "season": 3, "uk_ratings": 7.21, "doctor": 10, "writer": "cornell"},
{"episode": "silence in the library", "season": 4, "uk_ratings": 6.27, "doctor": 10, "writer": "moffat"},
{"episode": "forest of the dead", "season": 4, "uk_ratings": 7.84, "doctor": 10, "writer": "moffat"},
{"episode": "midnight", "season": 4, "uk_ratings": 8.05, "doctor": 10, "writer": "davies"},
{"episode": "a good man goes to war", "season": 6, "uk_ratings": 7.51, "doctor": 11, "writer": "moffat"},
{"episode": "let's kill hitler", "season": 6, "uk_ratings": 8.10, "doctor": 11, "writer": "moffat"},
@airportyh
airportyh / FP.md
Created June 25, 2018 15:15
Faith's FP lesson examples

Higher Order Functions

A function is a value, and can be stored in a variable, passed to another function as an argument, or returned as a return value by another function.

Teaching Assistant Do's and Dont's

Don't

  • Be heads down doing your own work
  • Scoff or laugh at students when uncovering a gap in their knowledge, no matter how big the gap
  • Urge them to hurry up if their coding speed is not on par with yours
  • Write code for them without explaining what you are doing
  • Take over a student's computer for an extended period of time

Optionally Nullable

We are incrementally upgrading a JS app to TS. We are using the strict null check option, which we deem important to helping us deliver quality code. During the upgrade process, we encountered a scenario where for a given object with a fixed set of properties, although we'd like to assume the values of the properties are there in the main path of the program, we'd like for them to be null for a couple of special cases:

  1. When we are creating a new version of the object, and all of its values ---

More Exercises for Lesson 2.5

Scores

The judges gave these scores:

scores = [7, 8, 9, 10, 5, 6, 7, 3, 4]
function main(authors) {
authors.forEach(function(author) {
let name, articles;
if (author) {
if (author.name) {
name = author.name;
} else if (author.firstName) {
if (author.lastName) {
name = author.firstName + ' ' + author.lastName;
} else {
sentence = input('Enter a sentence')
new_sentence = ''
for char in sentence:
if char == ' ':
new_sentence = new_sentence + '-'
elif char in '.,':
pass # means do nothing
else:
new_sentence = new_sentence + char
Build target: DEBUG
[18:28:39] Using gulpfile ~/Home/Insiten/hello-react-webpart/gulpfile.js
[18:28:39] Starting gulp
[18:28:39] Starting 'serve'...
[18:28:39] Starting subtask 'pre-copy'...
[18:28:39] Finished subtask 'pre-copy' after 2.77 ms
[18:28:39] Starting subtask 'copy-static-assets'...
[18:28:39] Starting subtask 'sass'...
[18:28:40] Finished subtask 'sass' after 619 ms
[18:28:40] Starting subtask 'tslint'...
export const CREATE_TASK = 'CREATE_TASK';
export type CREATE_TASK = typeof CREATE_TASK;

How Much Time To Learn It?

I started with the 3x3x3 video by Noah Richardson (linked below) and was able to solve the cube in 2-3 hours after I had written the instructions down on paper and only using the paper as a cheatsheet. Memorizing the cheatsheet and being able to solve it completely by myself took another day of on and off practice. I would memorize and practice one sequence/algorithm at a time, until I memorized them all.

The 2x2x2 has fewer steps and is easier to solve. I think it's a good beginner's cube. Some of algorithms are also very similar to the 3x3x3.