I've deprecated this Gist and migrated the CER FAQ to my faculty webpage:
https://github.com/amyjko/faculty/blob/master/components/cer.js
Feel free to submit pull requests on that file to make additions or corrections.
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta http-equiv="Content-type" content="text/html; charset=utf-8"> | |
<title>Testing Pie Chart</title> | |
<!--<script type="text/javascript" src="d3/d3.v2.js"></script>--> | |
<script src="http://d3js.org/d3.v2.js"></script> | |
<!-- Note: I made good use of the sample code provided by the D3JS community and extended it to fit my needs to create this simple dashboard --> | |
<style type="text/css"> |
I've deprecated this Gist and migrated the CER FAQ to my faculty webpage:
https://github.com/amyjko/faculty/blob/master/components/cer.js
Feel free to submit pull requests on that file to make additions or corrections.
#lang send-exp racket | |
(require racket/draw) | |
(define-syntax-rule (build-path (p) body ...) | |
(let ((p (new dc-path%))) | |
body ... | |
p)) | |
(define (quarter-circle p cx cy quarter radius) |
Pre-reqs:
Instructions tested with a Raspberry Pi 2 with an 8GB memory card. Probably also works fine on a Raspberry Pi 3.
Download the latest Raspbian Jessie Light
image. Earlier versions of Raspbian won't work.
Write it to a memory card using Etcher, put the memory card in the RPi and boot it up.
#lang racket/base | |
(require 2htdp/universe 2htdp/image lang/posn) | |
; The gravitational constant G | |
(define G 6.67428e-11) | |
; Assumed scale: 100 pixels = 1AU | |
(define AU (* 149.6e6 1000)) | |
(define SCALE (/ 250 AU)) | |
(struct body (id px py vx vy mass radius color) #:mutable #:transparent) ;Structure of body |
#lang scribble/doc | |
Okay, we've made a package and up loaded. But you know what would be lovely?. | |
Docs! This tutorial is going to start assuming you have a blank file and now clue where to start. By | |
the end we will have written the documentation for this line-of-best-fit library <show>. | |
This is racket land, so of course we have a language for documentation! #lang scribble/doc | |
@(require scribble/manual |
#lang racket | |
(require pict/color) | |
(provide | |
(contract-out | |
[cat-silhouette | |
(->i ([width positive?] [height positive?]) | |
(#:left-ear-extent [left-ear-extent (>=/c 0)] | |
#:left-ear-arc [left-ear-arc (real-in 0 (* 2 pi))] | |
#:left-ear-angle [left-ear-angle (real-in 0 (* 2 pi))] |
#lang racket | |
(provide tweet! (struct-out oauth) current-oauth) | |
(require (only-in racket/random crypto-random-bytes) | |
json | |
net/url | |
(only-in net/uri-codec [uri-unreserved-encode %]) | |
web-server/stuffers/hmac-sha1 | |
(only-in net/base64 base64-encode)) | |
;; tweet! : String -> JSON |
#lang send-exp racket | |
(require racket/draw) | |
(define-syntax-rule (build-path (p) body ...) | |
(let ((p (new dc-path%))) | |
body ... | |
p)) | |
(define (quarter-circle p cx cy quarter radius) |