I hereby claim:
- I am cindywu on github.
- I am cindywu (https://keybase.io/cindywu) on keybase.
- I have a public key whose fingerprint is 7FF7 97E2 A860 CCC4 2611 7B7B FD36 D4EE 837A 9972
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
(define count 1) | |
(define (crackle-pop count n) | |
(cond ((and (= 0 (remainder count 3))(= 0 (remainder count 5))) (display "CracklePop\n")) | |
((= 0 (remainder count 3))(display "Crackle\n")) | |
((= 0 (remainder count 5))(display "Pop\n")) | |
(else (display count)(display "\n"))) | |
(if (> n count) (crackle-pop (+ count 1) n))) | |
(crackle-pop count 100) |
; 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)) |
(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." |
(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)) |
;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) |
# 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]}|" |
(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 |
(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 |
// 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 |