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
(defun org-skim-open (my-path) | |
(interactive) | |
(shell-command (concat "open " skim-pdf-path "/" (car (split-string my-path "#")) ".pdf")) | |
(skim-page-absolute (string-to-number (cdr (split-string my-path "#"))))) |
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
nth 1 (split-string my-path "#"))))) |
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
;;; -*- lexical-binding: t -*- | |
(setq skim-pdf-path "~/Bibdesk") | |
(org-add-link-type "bib" 'org-skim-open) | |
(defun skim-page (&optional offset) | |
(interactive) | |
(when (not offset) (setq offset 1)) | |
(do-applescript (format " | |
tell document 1 of application \"Skim\" to set a to index of current page |
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
(setq skim-pdf-path "~/Bibdesk") | |
(org-add-link-type "bib" 'org-skim-open) | |
(defun skim-page (&optional offset) | |
(interactive) | |
(when (not offset) (setq offset 1)) | |
(do-applescript (format " | |
tell document 1 of application \"Skim\" to set a to index of current page | |
tell document 1 of application \"Skim\" to go to page (a + %d) | |
a" offset))) |
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
import Criterion.Main | |
import qualified School as S | |
import qualified School2 as S2 | |
list = [(1, ["Peter", "John", "Niels", "Adam", "Kris", "Pringle", "Bonus"]) | |
,(2, ["Arun", "Gambas", "Pierre", "Donau", "Arielle", "Jonathan"])] | |
--addMany :: (Int -> String -> School -> School) -> School -> [(Int, [String])] -> School | |
addMany fn = foldr addgrade | |
where |
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
import re | |
def getcase(l): | |
return(re.search(r"Case: (.+?),", l).groups()[0]) | |
def splitcase(c): | |
return(c.split("-20")) | |
with open("/Users/Stian/Downloads/ExportedCases-20140508_share.csv") as f: |
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
fn <- function(x) { | |
if(class(x) == "function") return(x) else { | |
print(class(x)) | |
# escape percentage marks within strings | |
x = gsub("'(.+)?%([1-9]?)(.+)?'","'\\1^^^\\2\\3'", x) | |
# if a single word, call one argument, otherwise analyze arguments | |
if(grepl("^[a-zA-Z.]*$", x)) { x = paste0(x,"(x1)")} else { | |
x = gsub("%([^1-9])", "%1\\1", x) | |
x = gsub("'", "\"", x) |
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
{ | |
"metadata": { | |
"name": "" | |
}, | |
"nbformat": 3, | |
"nbformat_minor": 0, | |
"worksheets": [ | |
{ | |
"cells": [ | |
{ |
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
--- | |
output: html_document | |
--- | |
# Report on first NAP survey | |
```{r echo=FALSE, message=FALSE, results='asis', prompt=FALSE} | |
library(knitr) | |
opts_chunk$set(echo=F, warning=F,message=F,results="asis", prompt=F, error=F) | |
setwd("/Users/Stian/Dropbox/NAP/Survey") | |
library(ggplot2) |