Skip to content

Instantly share code, notes, and snippets.

Avatar

Lars Vilhuber larsvilhuber

View GitHub Profile
@larsvilhuber
larsvilhuber / aeagit.bash
Created Jun 23, 2020
Prepare a AEA replication
View aeagit.bash
#!/bin/bash
AEASRC=git@bitbucket.org:aeaverification
call=$0
urlbase=https://aeadataeditors.atlassian.net/browse/AEAREP-
os=$(uname)
codeeditor=$(which code)
function code {
case $os in
Linux|Darwin)
@larsvilhuber
larsvilhuber / aeareview.bash
Last active Aug 17, 2020
Convenience script to prepare revision
View aeareview.bash
#!/bin/bash
sed -i.bak 's/- \[REQUIRED\]/> [We REQUESTED]/;s/> \[REQUIRED\]/> [We REQUESTED]/' REPLICATION.md
@larsvilhuber
larsvilhuber / aeareq.bash
Created Jun 23, 2020
A convenience script to parse the REPLICATION.md
View aeareq.bash
#!/bin/bash
if [[ "$1" == "sug" ]]
then
sed -i.bak2 '/-------/r'<(grep SUGGESTED REPLICATION.md | sed 's/>/-/') REPLICATION.md
fi
sed -i.bak '/-------/r'<(grep REQUIRED REPLICATION.md | sed 's/>/-/') REPLICATION.md
@larsvilhuber
larsvilhuber / aeaready.bash
Last active Aug 17, 2020
A convenience script to speed up part of the report review
View aeaready.bash
#!/bin/bash
os=$(uname)
apperror=0
if [[ -z $1 ]]
then
echo "Please add issue number"
exit 2
fi
num=$1
@larsvilhuber
larsvilhuber / URL
Last active Jun 22, 2020
Adding an online Zotero group to any application as a bibtex file
View URL
https://api.zotero.org/groups/(GROUP-ID)/items?format=bibtex&limit=150
where (GROUP-ID) is the numeric identifier associated with your group library.
This will download a BIB file. Other formats, see the Zotero API.
@larsvilhuber
larsvilhuber / build.sh
Last active Apr 11, 2020
Basic LaTeX compile with Github Actions
View build.sh
#!/bin/bash
# This is needed by the main.yml
# Goes into ${ROOT}/bin
DOCS="main"
DEST="docs"
[[ -d $DEST ]] || mkdir $DEST
# xelatex does not work
@larsvilhuber
larsvilhuber / install.log
Created Mar 8, 2020
ggplot2 fails install on French-language Windows system
View install.log
R version 3.6.3 (2020-02-29) -- "Holding the Windsock"
Copyright (C) 2020 The R Foundation for Statistical Computing
Platform: x86_64-w64-mingw32/x64 (64-bit)
R est un logiciel libre livré sans AUCUNE GARANTIE.
Vous pouvez le redistribuer sous certaines conditions.
Tapez 'license()' ou 'licence()' pour plus de détails.
R est un projet collaboratif avec de nombreux contributeurs.
Tapez 'contributors()' pour plus d'information et
@larsvilhuber
larsvilhuber / program.R
Created Jan 30, 2020
Conditional handling of (non-distributable) absent data
View program.R
# this project might have some confidential data that cannot be distributed
# Rather than break the program, or worse, ask replicators to comment out lines,
# provide a clean skip of those things, or even an alternate output (robustness check?)
basepath <- c("/path/to/project")
# or :
# basepath <- here::here()
# set filepaths relative to basepath
confidential <- file.path(basepath,"data","confidential")
@larsvilhuber
larsvilhuber / aeagit
Created Jan 27, 2020
bitbucket shortcut for AEA
View aeagit
#!/bin/bash
AEASRC=git@bitbucket.org:aeaverification
call=$0
urlbase=https://aeadataeditors.atlassian.net/browse/AEAREP-
os=$(uname)
codeeditor=$(which code)
function code {
case $os in
Linux)
View hamming.tex
The \emph{Hamming} metric on $\mscr X^n$ is $H: \mscr X^n \times \mscr X^n \rightarrow \ZZ^{\geq 0}$, defined by $H(\ul x,\ul x') =\# \{i \mid x_i\neq x'_i\}$. %In other words, the Hamming distance counts the number of entries that differ between $X$ and $X'$.
You can’t perform that action at this time.