Skip to content

Instantly share code, notes, and snippets.

View robinvanemden's full-sized avatar
🌳
⏩ ⏩

Robin van Emden robinvanemden

🌳
⏩ ⏩
View GitHub Profile
# -*- coding: utf-8 -*-
#==============================================================================
# Reset IPython - may delete the following when not making use of Spyder IDE
from IPython import get_ipython
get_ipython().magic('reset -sf')
# import libraries
# -*- coding: utf-8 -*-
import libs.lif as lf
key = "question"
value = self.context['question']
theta = self.get_theta(all_float=False, key=key, value=value)
Lif = lf.Lif(theta, x0=self.context['x0'], A=self.context['A'], T=150, gamma=.06, omega=1.0, lifversion=1)
Lif.update(self.action["t"],self.action["x"], self.reward)
self.set_theta(Lif, key=key, value=value)
@robinvanemden
robinvanemden / ufw.sh
Last active July 22, 2016 10:41 — forked from kim3er/script
IP address limited UFW firewall config for Couchbase 4.5
#!/bin/sh
IP_ADDRESS="192.168.0.2"
ufw allow from $IP_ADDRESS to any port 4369
ufw allow from $IP_ADDRESS to any port 8091
ufw allow from $IP_ADDRESS to any port 8092
ufw allow from $IP_ADDRESS to any port 11214
ufw allow from $IP_ADDRESS to any port 11215
ufw allow from $IP_ADDRESS to any port 11209
-- Authware 7.0 Script,
-- Robin van Emden 2015
-- http://pavlov.tech/2015/03/04/authorware-to-arduino-interface/
-- Communicates with an Arduino
-- Over Serial Port on a PC
-- Implements DirectCommunication Xtra from
-- http://www.directxtras.com/dcomm_home.asp
-- Instantiate the DirectCommunication Xtra
Trace("--- DirectCommunication -- ")
@robinvanemden
robinvanemden / basic_spatial_geojson_example_data.json
Last active September 12, 2016 15:46
Querying Couchbase 4.1, Geospatial Views & GeoJSON in PHP
{
"type": "bird",
"name": "pooky",
"date": "09-04-16T16:09:42.918Z02:00",
"location": {
"type": "Point",
"coordinates": [
3.1,
5
]
@robinvanemden
robinvanemden / b1.js
Created September 19, 2016 12:44
Default JSON format project B1
{
"_id":"24:4B:03:39:E7:91",
"type":"bird",
"name":"pooky",
"date":"2016-09-19T14:33:38.964Z",
"location":{
"type":"Point",
"coordinates":[
52.49177162129288,
4.451482822254181
##############################################################
#
# read_totem_data.R
#
# Import script
#
# Parses raw Totem Sensor accelerometer data in R
# And looks for peaks (steps, cycles, repeats)
#
# Crashlytics - plaintext stacktrace downloaded by Robin van Emden at Sat, 05 Nov 2016 17:36:33 GMT
# URL: https://fabric.io/pwy/android/apps/org.pvlv.birdy/issues/581e118a0aeb16625b856fe0/sessions/581e0d6900eb000119c2c6bd7c1c2ea8
# Organization: Pwy
# Platform: android
# Application: Birdy
# Version: 1.0 (1)
# Bundle Identifier: org.pvlv.birdy
# Issue #: 2
# Issue ID: 581e118a0aeb16625b856fe0
# Session ID: 581e0d6900eb000119c2c6bd7c1c2ea8
@robinvanemden
robinvanemden / Data_Sim_Basic_Lif.py
Last active November 10, 2016 17:22
Basic LiF Sims
# -*- coding: utf-8 -*-
import numpy as np
import matplotlib.pyplot as plt
import json
import pandas as pd
pd_csv = pd.read_csv('face_clean_with_demo.csv')
@robinvanemden
robinvanemden / QualtricsJSPsychHeader.html
Last active November 30, 2016 13:16
Loading external jQuery and jsPsych libraries in Qualtrics header
<!-- Load external jQuery -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script>var jq=$.noConflict();</script>
<!-- Load the jspsych library and plugins, after upload to file library -->
<script src="https://uleidenss.eu.qualtrics.com/ControlPanel/File.php?F=F_8BprgXBclFbi4gl"></script>