Skip to content

Instantly share code, notes, and snippets.

View cindywu's full-sized avatar
🍍
i do not want to turn into dust, but into ashes instead

Cindy Wu cindywu

🍍
i do not want to turn into dust, but into ashes instead
View GitHub Profile
@cindywu
cindywu / mls.md
Created May 31, 2020 23:40
machine learning systems notes

machine learning systems

by jeff smith

part 1: fundamentals of reactive machine learning

chapter 1: learning reactive machine learning

  • introducing the components of machine learning systems
  • understanding the reactive systems design paradigm
@cindywu
cindywu / bonilla-rosso-2020-pnas.tei.xml
Created May 28, 2020 23:23
Bonilla-Rosso et al. 2020 - PNAS
Grobid
About TEI PDF Patent Doc
Service to call
Process Fulltext Document
Consolidate header Include raw affiliations
Consolidate citations Include raw citations
[email protected] Change Remove
@cindywu
cindywu / mls-ch-4.scala
Created May 25, 2020 06:38
machine learning systems chapter 4
// import Tokenizer and HasingTF... you might need IDF later?
import org.apache.spark.ml.feature.{HashingTF, IDF, Tokenizer}
// import Pipeline
import org.apache.spark.ml.Pipeline
// 4.1 extracting features
def extract(rawData: RawData): Feature = ???
// 4.2 extracting word features from squawks
@cindywu
cindywu / ttt-computerplayer.scm
Created May 8, 2020 12:34
computer player 'o picks 2
(define board '(1 2 3 4 5 6 7 8 9))
(define win-combos '((1 2 3) (4 5 6) (7 8 9) (1 4 7) (2 5 8) (3 6 9) (1 5 9) (3 5 7)))
(define (won win-combos board)
(cond
((null? win-combos)#f)
((equal? '(x x x) (returncombostate (car win-combos) board)) #t)
((equal? '(o o o) (returncombostate (car win-combos) board)) #t)
(else
@cindywu
cindywu / tictactoe.scm
Last active May 5, 2020 03:18
it barely works
(define board '(1 2 3 4 5 6 7 8 9))
(define win-combos '((1 2 3) (4 5 6) (7 8 9) (1 4 7) (2 5 8) (3 6 9) (1 5 9) (3 5 7)))
(define (won win-combos board)
(cond
((null? win-combos)#f)
((equal? '(x x x) (returncombostate (car win-combos) board)) #t)
((equal? '(o o o) (returncombostate (car win-combos) board)) #t)
(else
@cindywu
cindywu / tic-tac-toe
Created May 4, 2020 08:49
tic-tac-toc
# new_game = TicTacToe.new
# new_game.play
class TicTacToe
def initialize(board = nil)
@board = ["1", "2", "3", "4", "5", "6", "7", "8", "9"]
end
def display_board(board)
puts "|#{board[0]}|#{board[1]}|#{board[2]}|"
puts "|#{board[3]}|#{board[4]}|#{board[5]}|"
@cindywu
cindywu / talk
Last active May 3, 2020 04:50
talk
;server
(defparameter my-socket (socket-server 4321))
(defparameter my-stream (socket-accept my-socket))
;client
(defparamenter my-stream (socket-connect 4321 "127.0.0.1"))
(print "Yo Server!" my-stream)
;client recieves
(read my-stream)
(defun guess-my-number()
(ash (+ *small* *big*) -1))
(defun smaller ()
(setf *big* (1- (guess-my-number)))
(guess-my-number))
(defun bigger ()
(setf *small* (1+ (guess-my-number)))
(guess-my-number))
(define answers
'("It is certain."
"It is decidedly so."
"Without a doubt."
"Yes -- definitely."
"You may rely on it."
"As I see it, yes."
"Most likely."
"Outlook good."
"Yes."
; this works!
; (crackle-pop 15) returns 1514131211109876543210
(define (crackle-pop n)
(display n)
(if (> n 0) (crackle-pop (- n 1))))
; show crackle if divisible by 3
; (crackle-pop 15) returns Crackle1413Crackle1110Crackle87Crackle54Crackle21Crackle
(define (crackle-pop n)
(if (= 0 (remainder n 3))