I hereby claim:
- I am benjic on github.
- I am benjic (https://keybase.io/benjic) on keybase.
- I have a public key ASCOmrDL6thNQj3_vx9Wdn1X0TlfknKRg-vyciKcjbNzIQo
To claim this, I am signing this object:
{ | |
init: function(elevators, floors) { | |
var elevator = elevators[0]; // Let's use the first elevator | |
// Whenever the elevator is idle (has no more queued destinations) ... | |
elevator.on("idle", function() { | |
// let's go to all the floors (or did we forget one?) | |
elevator.goToFloor(0); | |
elevator.goToFloor(1); | |
}); |
import math | |
import numpy as np | |
def rule4(Q, A, dA, m, B, dB, n): | |
"""Computes the error propagation for the form c A^m * B^n""" | |
return abs(Q) * math.sqrt((m * (dA / A))**2 + (n * (dB / B))**2) | |
# Capture measurements | |
height = 22.65e-3 # meters | |
radius = 8.60e-3 / 2 # meters |
module Main where | |
mergeSort :: (Ord a) => [a] -> [a] | |
mergeSort ns | |
-- Recursively call merge s | |
| length ns > 1 = merge (mergeSort left, mergeSort right) | |
-- This is the base case where recursion stops | |
| otherwise = ns | |
where | |
-- Split the list in half |
I hereby claim:
To claim this, I am signing this object:
package add | |
func Add(a, b int) int { | |
return a + b | |
} |
--- Day 2: Bathroom Security ---
You arrive at Easter Bunny Headquarters under cover of darkness. However, you left in such a rush that you forgot to use the bathroom! Fancy office buildings like this one usually have keypad locks on their bathrooms, so you search the front desk for the code.
"In order to improve security," the document you find says, "bathroom codes will no longer be written down. Instead, please memorize and follow the procedure below to access the bathrooms."
The document goes on to explain that each button to be pressed can be found by starting on the previous button and moving to adjacent buttons on the keypad: U moves up, D moves down, L moves left, and R moves right. Each line of instructions corresponds to one button, starting at the previous button (or, for the first line, the "5" button); press whatever button you're on at the end of each line. If a move doesn't lead to a button, ignore it.
You can't hold it much longer, so you decide to figure out the code as you walk to the ba
package main | |
import ( | |
"encoding/base64" | |
"fmt" | |
"net/http" | |
"net/http/httputil" | |
"net/url" | |
"os" | |
) |