Skip to content

Instantly share code, notes, and snippets.

@ljwolf
ljwolf / joyplot.py
Last active April 1, 2023 18:41
Joyplotting in python
def joyplot(data, ax=None,
flatten = .1, #rescale the height of each distribution to avoid overlap. If large, will flatten out each of the KDEs
linecolor='k',
shadecolor='w',
alpha=1,
shade=True,
line_kws = None,
kde_kws=None,
fig_kws=None,
shade_kws=None):

Install dlib and face_recognition on a Raspberry Pi

Instructions tested with a Raspberry Pi 2 with an 8GB memory card. Probably also works fine on a Raspberry Pi 3.

Steps

Download the latest Raspbian Jessie Light image. Earlier versions of Raspbian won't work.

Write it to a memory card using Etcher, put the memory card in the RPi and boot it up.

---
title: "Airport Wi-Fi"
author: ""
date: "`r sprintf('Last run: %s', format(Sys.time(), '%d %B, %Y'))`"
output:
html_document:
code_download: true
---
```{r setup, include=FALSE}
@darribas
darribas / geoplot_viridis.ipynb
Last active March 23, 2017 16:33
`geoplot` Viridis
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ctesta01
ctesta01 / qsf_explanation.md
Last active March 27, 2025 17:19
How does a Qualtrics Survey File work?

Quickstart Guide to undertsanding the Qualtrics Survey File

This information is likely to quickly become outdated when Qualtrics next changes the formatting of the QSF file. This guide was started February 2017. I hope that it is a useful introduction to understanding the contents of the QSF file that one can download from Qualtrics.

This document includes:

#load the package
require(h2o)
#start h2o
localH2o <- h2o.init(nthreads = -1, max_mem_size = "20G")
#load data on H2o
trainh2o <- as.h2o(train)
testh2o <- as.h2o(test)
library(idbr)
library(ggplot2)
library(animation)
library(dplyr)
library(gganimate)
idb_api_key("Your Census API key goes here")
male <- idb1('IN', 2000:2050, sex = 'male') %>%
mutate(POP = POP * -1,
@stuartlynn
stuartlynn / Segmentation.ipynb
Last active March 17, 2016 14:59
Segmentation Generation from Census and PUMAS
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@vasishth
vasishth / ExampleExamCode.R
Last active February 2, 2020 01:15
Example code for automatically generating R exercises and exams
## Load library:
library("exams")
## exam questions:
myexamlist<-list("pnorm1","sesamplesize1multiplechoice")
## output directory
## create new test dir if one does not exist:
files.list<-system("ls",intern=TRUE)
@vasishth
vasishth / test.tex
Created January 17, 2016 19:24
Example exam template for automating exams and homework using the exam package.
\documentclass[10pt,a4paper]{article}
%% packages
\usepackage{a4wide,verbatim,Sweave,url}
%% new environments
\newenvironment{question}{\item}{}
\newenvironment{solution}{\comment}{\endcomment}
\newenvironment{answerlist}{\renewcommand{\labelenumi}{(\alph{enumi})}\begin{enumerate}}{\end{enumerate}}