This file contains 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
# based on Heroku's documentation | |
require './streaming' | |
run Sinatra::Application |
This file contains 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
#include <stdio.h> | |
#include <string.h> | |
#define MAXLEN 256 | |
void reverse(char *s, char *r); | |
main() { | |
char s[MAXLEN] = "hello reversed world!"; | |
char r[MAXLEN]; |
This file contains 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
def add(m, n) | |
total = m | |
for i in 1..n do | |
total += 1 | |
end | |
total | |
end | |
def exp(m, n) | |
total = 1 |
This file contains 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
; SICP Exercise 1.8 | |
#lang racket | |
(define (cube-root x) | |
(define (square y) (* y y)) | |
(define (good-enough? guess) | |
(< (abs (- (square guess) x)) 0.001)) | |
(define (improve guess) | |
(/ (+ (square (/ guess x)) (* 2 guess))) 3) |
This file contains 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
; SICP Exercise 1.1 | |
10 => 10 | |
(+ 5 3 4) => 12 | |
(- 9 1) => 8 | |
(/ 6 2) => 3 | |
(+ (* 2 4) (- 4 6)) => 6 | |
(define a 3) | |
(define b (+ a 1)) | |
(+ a b (* a b)) => 19 |
This file contains 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
ANTELOPES = [:addax,:antelope,:antilopine,:ariel,:blackbuck,:blaubok,:bluebuck,:bloubok,:blesbok,:blesbuck,:bok,:bongo,:bontebok,:boschbok,:boshbok,:bosbok,:bubal,:bubale,:bubalis,:bubaline,:cabrie,:cabrit,:chamois,:chikara,:chinkara,:chiru,:dikdik,:duiker,:duyker,:duikerbok,:dzeren,:eland,:gazelle,:gemsbok,:gemsbuck,:gerenuk,:gnu,:goa,:gooral,:goral,:grysbok,:hartbees,:hartebeest,:hartbeest,:impala,:inyala,:nyala,:kaama,:klipspringer,:kob,:kongoni,:koodoo,:kudu,:lechwe,:madoqua,:marshbuck,:mhorr,:mohr,:nagor,:nilgai,:nilgau,:nilghai,:nilghau,:nylghai,:nylghau,:oribi,:ourebi,:oryx,:palebuck,:pallah,:prongbuck,:pronghorn,:puku,:pygarg,:reebok,:rhebok,:reedbuck,:reitbok,:saiga,:sasin,:sassaby,:tsessebe,:serow,:shamois,:sitatunga,:situtunga,:springbok,:springbuck,:steenbok,:steinbok,:steinbock,:stembok,:stembuck,:steenbuck,:thar,:topi,:tragelaph,:antelope,:antilopine,:ariel,:blackbuck,:blaubok,:bluebuck,:bloubok,:blesbok,:blesbuck,:bok,:bongo,:bontebok,:boschbok,:boshbok,:bosbok,:bubal,:bubale,:bubalis,:bubaline |
This file contains 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
class ReportCard | |
def initialize(print_strategy) | |
@print_strategy = print_strategy.new | |
@grades = Hash.new | |
end | |
def add_grade(subject, grade) | |
@grades[subject] = grade | |
end |
NewerOlder