Skip to content

Instantly share code, notes, and snippets.

View briandk's full-sized avatar

Brian A. Danielak briandk

View GitHub Profile
@briandk
briandk / wringing-water-from-clothes.ipynb
Last active October 14, 2015 04:08
A real-life physics problem I had when my washer broke
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@briandk
briandk / position-details.md
Created October 23, 2015 19:04
A CSEd position at the University of Nebraska–Omaha
@briandk
briandk / improving-bibtex-autocomplete.md
Last active October 26, 2015 03:33
Improving bibtex-autocomplete for atom
@briandk
briandk / InstallingPandocOnMac.md
Last active September 28, 2021 18:39
How to install pandoc on a mac

Step 0 - Installing the XCode Development tools

Paste the following in your terminal, then press Enter and follow any prompts:

xcode-select --install

Step 1 - Install homebrew

@briandk
briandk / trying_to_reproduce_CRAN_errors.md
Last active December 2, 2015 20:31
I can't reproduce CRAN's package-check errors for granovaGG v. 1.4.0. This VM is my way of trying to figure out whether I'm crazy.

Background

After I submitted my package to CRAN yesterday, Uwe Ligges sent me a kind email letting me know CRAN was seeing NOTEs in its package check process. A classic problem for R package maintainers: we can't reproduce the package-check errors CRAN sees.

What I tried to do to reproduce the errors CRAN sees

I built an entire VM, essentially from scratch, that anyone with Vagrant and VirtualBox can run. My package passes all the checks with only one NOTE (about bypassing cyclic dependency checks).

How to reproduce things from my end

@briandk
briandk / UsingLaTeXinRMarkdown.Rmd
Created December 7, 2015 19:47
Rmarkdown is happy to take raw Markdown code. And, you can also include other LaTeX files to your heart's content using the YAML metadata block up top.
---
title: "Tufte Handout"
author: "John Smith"
date: "August 13th, 2014"
output: rmarkdown::tufte_handout
---
# Introduction
The Tufte-\LaTeX\ [^tufte_latex] document classes define a style similar to the style Edward Tufte uses in his books and handouts. Tufte's style is known for its extensive use of sidenotes, tight integration of graphics with text, and well-set typography.
@briandk
briandk / clean-install-pandoc-citeproc-log.txt
Created January 16, 2016 03:57
cabal install pandoc-1.16.0.2 fails with a dependency error on a clean ubuntu-trusty install. Here's the log from trying to install pandoc-citeproc to pin down the problem
root@vagrant-ubuntu-trusty-64:/vagrant# cabal install pandoc-citeproc
Resolving dependencies...
Downloading SHA-1.6.4.1...
Configuring SHA-1.6.4.1...
Building SHA-1.6.4.1...
Preprocessing library SHA-1.6.4.1...
[1 of 1] Compiling Data.Digest.Pure.SHA ( src/Data/Digest/Pure/SHA.hs, dist/build/Data/Digest/Pure/SHA.o )
In-place registering SHA-1.6.4.1...
Installing library in /root/.cabal/lib/SHA-1.6.4.1/ghc-7.6.3
Registering SHA-1.6.4.1...
@briandk
briandk / determineNumericalPrecisionInPython.py
Created January 28, 2016 18:35
Testing where Python's decimal precision craps out by asking when an integer equals it's repeating-nines expansion. (Ex: For how many repeating 9s does 2 = 1.999...)
def find_where_repeating_nines_equal_integers(known_integer, power_of_ten=1):
if known_integer == (known_integer - (10**power_of_ten)):
print("The Power of Ten was ", power_of_ten, "when the integer equaled the repeated nines")
print("known_integer was ", known_integer)
return(power_of_ten)
else:
find_where_repeating_nines_equal_integers(known_integer, (power_of_ten - 1))
@briandk
briandk / vector-graphic-plots-preamble.py
Last active May 22, 2024 10:21
Preamble for high resolution and vector-graphic plots in Jupyter Notebook
# Make plots inline
%matplotlib inline
# Make inline plots vector graphics instead of raster graphics
# from IPython.display import set_matplotlib_formats
# set_matplotlib_formats('pdf', 'svg')
# DeprecationWarning: `set_matplotlib_formats` is deprecated since IPython 7.23, directly use `matplotlib_inline.backend_inline.set_matplotlib_formats()`
import matplotlib_inline
matplotlib_inline.backend_inline.set_matplotlib_formats('retina', 'png', quality = 100)
@briandk
briandk / fitting-viral-load.R
Created February 7, 2016 05:26
Trying in vain to fit a double-exponential model
library(readr)
library(magrittr)
library(dplyr)
hiv_data <- read_csv(
"https://raw.githubusercontent.com/ComputationalModeling/IPML-Data/master/01HIVseries/HIVseries.csv",
col_names = c("time_in_days", "viral_load")
) %>%
mutate(log_viral_load = log(viral_load))