Short (72 chars or less) summary
More detailed explanatory text. Wrap it to 72 characters. The blank
line separating the summary from the body is critical (unless you omit
the body entirely).
Write your commit message in the imperative: "Fix bug" and not "Fixed
bug" or "Fixes bug." This convention matches up with commit messages
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
| --- | |
| title: "test" | |
| author: "Richard Smith-Unna" | |
| date: "21 May 2015" | |
| output: html_document | |
| --- | |
| Demo of reading an R file and dumping it raw into the HTML produced by knitr from RMarkdown, to get syntax highlighting. | |
| Put the code you want to display in `import.R`. |
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
| module Calc | |
| ( Expr(..) | |
| , parse | |
| , calculate | |
| ) where | |
| import Control.Applicative | |
| import Parser | |
| data Expr = Add Expr Expr |
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
| lseq <- function(from=1, to=100000, length.out=6) { | |
| # logarithmic spaced sequence | |
| # blatantly stolen from library("emdbook"), because need only this | |
| exp(seq(log(from), log(to), length.out = length.out)) | |
| } |
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
| Code | Lab | Country | Active | |
|---|---|---|---|---|
| A | University of Arizona | USA | 1 | |
| AA | NSF-Ariz. AMS Facility | USA | 1 | |
| AAR | University of Aarhus | Denmark | 1 | |
| AC | Ingeis | Argentina | 1 | |
| AECV | Alberta Environmental Center of Vegreville | Canada | 0 | |
| AERIK | Atomic Energy Res. Inst. | Korea | 0 | |
| ALG | Algiers | Algeria | 0 | |
| ANAS | Applied Nuclear-Atomic Science (ANAS) Lab. | South Korea | 1 | |
| ANL | Argonne Nat. Lab. | USA | 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
| library(shiny) | |
| library(ggplot2) | |
| shinyServer(function(input,output)({ | |
| # x contains all the observations of the x variable selected by the user. X is a reactive function | |
| x <- reactive({ | |
| iris[,as.numeric(input$var1)] | |
| }) | |
| # x contains all the observations of the y variable selected by the user. Y is a reactive function | |
| y <- reactive({ | |
| iris[,as.numeric(input$var2)] |
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
| #! /usr/bin/env bash | |
| # Install any build dependencies needed for curl | |
| sudo apt-get build-dep curl | |
| # Get latest (as of Feb 25, 2016) libcurl | |
| mkdir ~/curl | |
| cd ~/curl | |
| wget http://curl.haxx.se/download/curl-7.50.2.tar.bz2 | |
| tar -xvjf curl-7.50.2.tar.bz2 |
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
| /** | |
| * A simple theme for reveal.js presentations, derived from serif.css | |
| * It's in the spirit of the Metropolis theme for beamer https://github.com/matze/mtheme | |
| * | |
| * This theme is Copyright (C) 2016 Vince Hodges, http://sourdoughlabs.com - it is MIT licensed. | |
| */ | |
| @import url('https://fonts.googleapis.com/css?family=Fira+Sans'); | |
| .reveal a { |
Why should programmers care about Monoids? Because Monoids are a common pattern that shows up over and over in programming. And when patterns show up, we can abstract them and leverage work we've done in the past. This allows us to quickly develop solutions on top of proven, stable code.
Add Commutative Property to a Monoid (Commutative Monoid) and you have something that can be executed in parallel. With the end of Moore's Law, parallelism is our only hope to increasing processing speeds.
What follows is what I've learned after studying Monoids. It is hardly complete, but hopefully will prove to be helpful as an introduction for others.
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
| # Adapted from https://stackoverflow.com/a/7267364/1036500 by Andrie de Vries | |
| # This is it: theme(axis.text.x = element_text(angle = 90, hjust = 1, vjust = 0.5)) | |
| library(ggplot2) | |
| td <- expand.grid( | |
| hjust=c(0, 0.5, 1), | |
| vjust=c(0, 0.5, 1), | |
| angle=c(0, 45, 90), |