Skip to content

Instantly share code, notes, and snippets.

Avatar

Stephen Jeffrey Barr stephenjbarr

View GitHub Profile
View keybase.md

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 Dec 27, 2015
modification of John MacFarlane's BayHac 2014 example to output a PDF
View fuel.hs
{-# 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 Jun 26, 2015
Find images from a string using Duck Duck Go's API
View use_ddg.py
{
"metadata": {
"name": "",
"signature": "sha256:a1d46d6db61857a10a811537203ce4f5bea4db915cb1fbd2fc9835b10e6c2a35"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
View keybase.md

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:

View 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 Jan 4, 2015
Monad Transformer advice outline
View MTHelp.hs
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 Nov 7, 2014
using TheRandomMonad.hs
View 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
--
View ids.hs
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
View hw4-23.hs
{-# 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
View hw4-23-plotter.R
library(ggplot2)
library(cumplyr)
library(scales)
library(reshape2)
library(RColorBrewer)
library(tools)
library(gridExtra)