Skip to content

Instantly share code, notes, and snippets.

View stephenjbarr's full-sized avatar

Stephen Jeffrey Barr stephenjbarr

View GitHub Profile

Keybase proof

I hereby claim:

  • I am stephenjbarr on github.
  • I am stevejb (https://keybase.io/stevejb) on keybase.
  • I have a public key whose fingerprint is 7AC0 9ECF 0544 08B6 2ACF 7D1E 5B8B 2163 E43E D538

To claim this, I am signing this object:

@stephenjbarr
stephenjbarr / fuel.hs
Created December 27, 2015 21:40
modification of John MacFarlane's BayHac 2014 example to output a PDF
{-# LANGUAGE OverloadedStrings #-}
import Text.Pandoc.Builder
import Text.Pandoc
import Text.Pandoc.PDF
import Data.Monoid ((<>), mempty, mconcat)
import Data.Aeson
import Control.Applicative
import Control.Monad
import Control.Monad.IO.Class
import qualified Data.ByteString.Lazy as BL
@stephenjbarr
stephenjbarr / use_ddg.py
Created June 26, 2015 07:02
Find images from a string using Duck Duck Go's API
{
"metadata": {
"name": "",
"signature": "sha256:a1d46d6db61857a10a811537203ce4f5bea4db915cb1fbd2fc9835b10e6c2a35"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [

Keybase proof

I hereby claim:

  • I am stephenjbarr on github.
  • I am stevejb (https://keybase.io/stevejb) on keybase.
  • I have a public key whose fingerprint is 07C1 118A A251 AFDE 258C 2E7B FFD0 0625 D5E2 5321

To claim this, I am signing this object:

@stephenjbarr
stephenjbarr / sample-post
Created February 1, 2015 20:40
sample post
#+TITLE: Simple Example
#+AUTHOR: Stephen
#+DATE: 2015-01-30
#+HTML_DOCTYPE: html5
#+OPTIONS: toc:nil
* Headline 1
Here is a nice equation: \( x^{2} - 3 x^{3} - \alpha \beta \).
@stephenjbarr
stephenjbarr / MTHelp.hs
Created January 4, 2015 23:11
Monad Transformer advice outline
import Control.Monad
import Control.Monad.Reader
import Control.Monad.Random
import Data.Map as Map
import Data.Maybe
import Control.Seq as Seq
import Control.Monad.Par
import Control.DeepSeq
@stephenjbarr
stephenjbarr / TheRandomMonad.hs
Created November 7, 2014 16:44
using TheRandomMonad.hs
import Control.Monad.Random
import Data.List.Split as LS
bounds = [(10.0, 20.0), (5.0, 6.0), (3.0, 4.0), (100.0, 200.0)]
-- INPUT:
-- RandomGen random number generator for uniforms
-- [(Double, Double)] list of upper and lower bounds
-- Int number of lists of random numbers
--
inner_decentral_sino_st :: ProblemParams -> (Double,Double,Double) -> (Double,Double,Double)
inner_decentral_sino_st pp (simin, simed, simax) = (simin', simed', simax')
where
p = fromIntegral $ _pp_p pp :: Double
t = fromIntegral $ _pp_t pp :: Double
h = fromIntegral $ _pp_h pp :: Double
myf_val = myfunN1 simed pp
thresh = (p*t)/(p+h)
if myf_val < thresh then
{-# LANGUAGE DeriveDataTypeable #-}
module HW4_23 where
import Data.Typeable
import Data.Generics
import Math.Factorial
import Data.List
import System.IO
import Data.UUID as U
library(ggplot2)
library(cumplyr)
library(scales)
library(reshape2)
library(RColorBrewer)
library(tools)
library(gridExtra)