Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View robinvanemden's full-sized avatar
🌳
⏩ ⏩

Robin van Emden robinvanemden

🌳
⏩ ⏩
View GitHub Profile
@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>
@robinvanemden
robinvanemden / QualtricsQuestionJs.js
Created November 3, 2014 18:07
Adding jsPsych to Qualtrics
Qualtrics.SurveyEngine.addOnload(function() {
//Retrieve the Response ID from the hidden Qualtrics Session ID value
var responseIdFromSessionID = jq('#SessionID').val().replace("SS_", "R_");
//Retrieve Qualtrics object and save in qthis
var qthis = this;
//Hide buttons - can also (even better) be hidden in the CSS
jq('#Buttons').css("display", "none");
var qthis;
var globalInterval;
var counter = 0;
var continuecounter = 0;
Qualtrics.SurveyEngine.addOnload(function() {
qthis = this;
});
jq(window).load(function() {
<div id="basicdiv" style="position: relative; left: 0; top: 0; width: 920px; height: 575px;background-color:#666666;">
<img id="imgmask" src=
"https://uleidenss.eu.qualtrics.com/CP/Graphic.php?IM=IM_0Mw5SEViwkr67BP"
style="position: absolute; top: 0; left: 0; width: 920px; height: 575px; z-index: 1;">
<img id="imgself1" src=
"https://uleidenss.eu.qualtrics.com/CP/Graphic.php?IM=IM_8wE16Ir2f8GOW2h"
style="position: absolute; top: 0; left: 0; width: 920px; height: 575px; z-index: 2;">
<img id="imgself2" src=
"https://uleidenss.eu.qualtrics.com/CP/Graphic.php?IM=IM_5mNxaldk6WwG4SN"
-- 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 -- ")
/* Control a Peltier Cooler over Arduino Motor Shield from Authorware
Developed for Arduino Uno with a Velleman VMA23 or KA03 Motor Shield
The circuit:
* Peltier elements connected to the motor outputs A and B
* 50 V (max.) external power supply connected to motor input
Created 2015
by Robin van Emden
@robinvanemden
robinvanemden / BabyService.java
Created July 2, 2015 17:02
Audio Detector and Recorder
package com.hollandhaptics.babyapp;
import java.io.DataOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URL;
import java.text.SimpleDateFormat;
@robinvanemden
robinvanemden / UartService.java
Created September 1, 2015 13:41
Android BLE UART Service
package io.pavlov.bleuart;
import android.app.Service;
import android.bluetooth.BluetoothAdapter;
import android.bluetooth.BluetoothDevice;
import android.bluetooth.BluetoothGatt;
import android.bluetooth.BluetoothGattCallback;
import android.bluetooth.BluetoothGattCharacteristic;
import android.bluetooth.BluetoothGattDescriptor;
import android.bluetooth.BluetoothGattService;
<?php
/**
* A php implementation of the Hungarian algorithm for solving the assignment
* problem. An instance of the assignment problem consists of a number of
* workers along with a number of jobs and a cost matrix which gives the cost of
* assigning the i'th worker to the j'th job at position (i, j). The goal is to
* find an assignment of workers to jobs so that no job is assigned more than
* one worker and so that no worker is assigned to more than one job in such a
* manner so as to minimize the total cost of completing the jobs.
####
#
# read_sensor_data.R
#
# Import script. Parses MLX sensor data
#
# Robin van Emden - robin@pavlov.io - 2015
#
####