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 python3 | |
# Usage: python3 import_bibdesk_dates.py path/to/zotero.sqlite | |
# Will only touch records that have not been synced (i.e. "version" == 0) | |
import sqlite3 | |
import re | |
import datetime | |
import pytz | |
import dateutil.parser |
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
See video file |
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(vadr) | |
library(plyr) | |
# do "chain" arguments ever feature a dot on the second level (not in | |
# its own chain?) Answer by walking over expressions to pull out | |
# examples of usages. | |
dirs = c("~/analysis", "~/analysis/writing") | |
globs = c("*.r", "*.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
all: text.pdf text.html | |
text.pdf: bib.bib text.tex | |
git clean -f -e text.pdf -e text.html | |
latexmk -pdf text.tex -pdflatex="pdflatex -halt-on-error -interaction=nonstopmode" | |
text.image.html: text.pdf | |
cp text.bbl text.hbbl | |
hevea text.tex -o text.html < /dev/null |
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
'dot;color black' plot (; 50&}.@:((**(1-]))^:(i. 200)&0.25)) 2.4 ([+-~*((%~i.)100)) 4 | |
NB. 100 numbers in [0,1) ^^^^^^^^^ | |
NB. rescaled to ^^^^^ | |
NB. 100 numbers in [2.4,4) ^^^ ^ | |
NB. makes "x", ^^^^^^^^^^^^^^^^^^^^^^^^ | |
NB. ^^^^^^^^^ function y -> y * (1-y)*x | |
NB. ^^^^^^^^^^ applied 200 times | |
NB. ^^^^^ starting with y=0.25 | |
NB. ^^^^^^^ then dropping first 50 iterations | |
NB. ^ put original "x" alongside result |
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(microbenchmark) | |
lru_cache <- function(cache.size = 1000) { | |
lru <- new.env(hash=TRUE, parent=emptyenv(), size=cache.size) | |
pred <- new.env(hash=TRUE, parent=emptyenv(), size=cache.size) | |
succ <- new.env(hash=TRUE, parent=emptyenv(), size=cache.size) | |
pred$TAIL <- "HEAD" | |
succ$HEAD <- "TAIL" |
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
(require 'ess-site) | |
(require 'ess-rutils) | |
(setq ess-use-tracebug t) | |
(setq ess-dbg-auto-single-key-p nil) | |
(setq inferior-R-args "--no-save") | |
(setq TeX-auto-save t) | |
(setq TeX-auto-parse-self t) |
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
SEXP _find_subst_expressions_list(SEXP strs, SEXP begin, SEXP end) { | |
int ns, nb, ne; | |
assert_type(strs, STRSXP); | |
assert_type(begin, STRSXP); | |
assert_type(end, STRSXP); | |
ns = LENGTH(strs); | |
nb = LENGTH(begin); | |
ne = LENGTH(end); | |
int nout; |
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
Making install in m4 | |
make[2]: Nothing to be done for `install-exec-am'. | |
make[2]: Nothing to be done for `install-data-am'. | |
Making install in po | |
if test "libextractor" = "gettext-tools"; then \ | |
.././install-sh -c -d /usr/local/Cellar/libextractor/1.0.1/share/gettext/po; \ | |
for file in Makefile.in.in remove-potcdate.sin quot.sed boldquot.sed [email protected] [email protected] insert-header.sin Rules-quot Makevars.template; do \ | |
/usr/bin/install -c -m 644 ./$file \ | |
/usr/local/Cellar/libextractor/1.0.1/share/gettext/po/$file; \ | |
done; \ |
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
# lazy data frame | |
# | |
# like idata.frame, but exploits lazy evaluation + macro code generation | |
# instead of active bindings | |
library(vadr) | |
lazy.frame <- function(df, enclos=parent.frame(), ...) UseMethod("lazy.frame") | |
lazy.frame.lazy.frame <- function(df, ...) df |
NewerOlder