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
| """ | |
| The naive/stupid version where I actually created a tree... for unique paths... | |
| <https://leetcode.com/problems/unique-paths> | |
| before I realised we could just do simple DP of: #paths(i, j) = #paths(i, j + 1) + #paths(i + 1, j) | |
| ouch. | |
| """ | |
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
| s0, r0, g0, p0, n0 = :C3, :D3, :E3, :G3, :B3 | |
| s, r, g, p, n = :C4, :D4, :E4, :G4, :B4 | |
| s2, r2, g2, p2, n2 = :C5, :D5, :E5, :G5, :B5 | |
| define :maya do | |
| sleep 3 | |
| play_pattern_timed [s, s, r, s, r, s, r, r], 0.75, release: 3 | |
| sleep 3 | |
| play_pattern_timed [s, r, g, s, r, s, r, r], 0.75, release: 3 |
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
| package main | |
| import ( | |
| "bufio" | |
| "fmt" | |
| "os" | |
| "strconv" | |
| "github.com/AndreasBriese/bbloom" | |
| ) |
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
| #lang racket | |
| (define (mysqrt x) | |
| ;; a procedure to calculate square root of a number | |
| ;; starts with a guess and improves it until it is good enough | |
| ;; a guess can be improved by averaging itself with x/guess | |
| (define (avg a b) (/ (+ a b) 2.0)) | |
| (define (improve-guess guess x) (avg guess (/ x guess))) |
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
| bucket="SOME_BUCKET_NAME" | |
| prefix="SOME_PREFIX" | |
| objects="[" | |
| printf "\n\n>>> SALVAGING LOST DATA NOW\n\n" | |
| while : | |
| do | |
| count=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
| " Suhas vimrc | |
| " MIT License | |
| " Copyright 2018, <[email protected]> | |
| "---------------------------------------- | |
| " System: plugin manager | |
| "---------------------------------------- | |
| call plug#begin('~/.vim/plugged') | |
| Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' } |
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
| #define LED 8 | |
| #define PHOTORESISTOR A0 | |
| #define THRESHOLD 200 | |
| void setup() | |
| { | |
| Serial.begin(9600); | |
| pinMode(LED, OUTPUT); | |
| pinMode(PHOTORESISTOR, INPUT_PULLUP); | |
| Serial.println("Hello, Arduino"); |
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
| #define BUTTON 5 | |
| #define LED 8 | |
| void setup() | |
| { | |
| Serial.begin(9600); | |
| pinMode(LED, OUTPUT); | |
| pinMode(BUTTON, INPUT_PULLUP); | |
| Serial.println("Hello, Arduino"); | |
| } |
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
| /* | |
| MIT License | |
| Copyright 2017 Suhas SG <[email protected]> | |
| */ | |
| import scala.util._ | |
| object Solution extends App { | |
| val l = readInt | |
| val h = readInt |
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
| Map { | |
| background-color: #444; | |
| } | |
| #countries { | |
| ::outline { | |
| line-color: #aaa; | |
| line-width: 1; | |
| line-join: round; | |
| } |