Skip to content

Instantly share code, notes, and snippets.

View robinvanemden's full-sized avatar
🌳
⏩ ⏩

Robin van Emden robinvanemden

🌳
⏩ ⏩
View GitHub Profile
@robinvanemden
robinvanemden / basic_peak_detection.R
Created May 18, 2017 12:28
Basic scripts to import and work with Bobbi data
# ----------- Totem Bobbi basic data analysis in R ------------
# ----------- Based on: https://tinyurl.com/n3tw7lc -----------
library(ggplot2)
library(wavelets)
# ----------------- Load data, set vars ----------------------
# set home directory to this file's directory
setwd("C:\\Users\\robin\\PycharmProjects\\TotemHeartRate")
# -*- coding: utf-8 -*-
"""
Answers to assignments, "Coding the Matrix", by Philip N. Klein, Chapter 0.5
"""
###############################################################################
# 0.5.1 Number of minutes in a week
###############################################################################
print("\n### 0.5.1 ###\n")
Wrk2 client
Provider: Hetzner
Type server: Virtual server single core
OS: Clean Ubuntu-1604-xenial-64-minimal with custom /etc/sysctl.conf *
Wrk2: wrk 4.0.0 [epoll] https://github.com/giltene/wrk2
RAM: 1 GB
Hard Drive: SSD
Connection: 1 Gbit/s NIC
@robinvanemden
robinvanemden / CMAB.py
Created November 16, 2017 23:12 — forked from axlevisu/CMAB.py
A class which solves multi-armed bandit problem
from scipy.stats import beta
from scipy.integrate import quad
from random import randint
import numpy as np
from operator import add
#Contextual Multi-Armed Bandit for Bernoulli Case
class CMAB:
@robinvanemden
robinvanemden / LinUCB.ipynb
Created November 16, 2017 23:12 — forked from tushuhei/LinUCB.ipynb
LinUCB implementation based on Chu, Wei, et al. "Contextual Bandits with Linear Payoff Functions." AISTATS. Vol. 15. 2011.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
import numpy as np
class ContextualThompson(object):
def __init__(self, d=10, R=0.01, epsilon=0.5, delta=1.0, n_arms=10):
self.n_arms = n_arms
self.d = d
self.R = R
self.delta = delta
self.epsilon = epsilon
import random
import time
import matplotlib.pyplot as plt
import numpy as np
from numpy import linalg as la
DIM = 10.0
GRAPH_NUM = 520
#!/bin/sh
#
# Startup / shutdown script for the couchbase server
#
# Copyright (c) 2011, Couchbase, Inc.
# All rights reserved
#
#
### BEGIN INIT INFO
# Provides: couchbase-server
@robinvanemden
robinvanemden / cb_upgrade.txt
Created January 17, 2018 08:40
Couchbase Sync Gateway and Server - upgrade 1.3.1 to 1.5.1 and 4.5 to 5.0.1
# Update letsencrypt certificate (TODO: make into cronjob)
cp /etc/letsencrypt/live/cb.mnds.org/* /home/sync_gateway
chown -R sync_gateway.sync_gateway *
# Couchbase 4.5 to 5.0
service sync_gateway stop
/etc/init.d/couchbase-server stop
@robinvanemden
robinvanemden / electromagnet_mosfet_arduino.ino
Last active June 28, 2018 12:39
Control electromagnets over Arduino, making use of RFP30N06LE N-Channel MOSFET
/*
Control an electromagnet over Arduino, using an RFP30N06LE N-Channel MOSFET
Developed for Arduino Uno and the MOSFET Power Control Kit, COM-12959
Created 2018
by Robin van Emden
*/