Skip to content

Instantly share code, notes, and snippets.

View lindemann09's full-sized avatar
🐧

Oliver Lindemann lindemann09

🐧
View GitHub Profile
@lindemann09
lindemann09 / expy_numpy_demo.py
Last active September 26, 2017 14:04
Expyriment: PixelArray and numpy Demo
import pygame
import pygame.surfarray as surfarray
import numpy
from expyriment import control
from expyriment.stimuli import Canvas
class PGSurface(Canvas):
"""PyGame Surface: Expyriment Stimulus for direct Pygame operations and
PixelArrays
#!/usr/bin/env python
# coding: utf8
import csv
import datetime
from orderedset import OrderedSet
from docx import Document
@lindemann09
lindemann09 / credit-point-vouchers.py
Created June 12, 2017 14:02
Generate subject hour vouchers via with Python and PDFlatex
#!/usr/bin/env python
# -*- coding: iso-8859-1 -*-
"""
Generate tex files with subject hour vouchers and a code list
and run pdflatex.
Version 0.5
(c) 2012-2015, Oliver Lindemann
@lindemann09
lindemann09 / mouse_press_demo.py
Created July 8, 2016 07:50
mouse_press_demo.py
# quit program by pressing <ESC>
from expyriment import io, control
control.set_develop_mode(True)
control.initialize()
mouse = io.Mouse()
control.start(skip_ready_screen=True)
@lindemann09
lindemann09 / spss2csv.R
Created January 7, 2016 14:16
Convert SPSS data (.sav) to comma-separated text (.csv)
#!/usr/bin/Rscript
#
# Converts spss file to csv-file ("output.csv")
#
# usage:
# Rscript spss2csv.R <FILENAME>
library(foreign)
args <- commandArgs(trailingOnly = TRUE)
data = read.spss(args[1], to.data.frame=TRUE)
"""
Formal design of the experiment "sub-symbolic-place-value"
"""
def dec2base_x(n, base):
"""base x array (numpy array) of the decimal n"""
rtn = []
while(n>0):
rtn.append(n%base)
n = n/base
@lindemann09
lindemann09 / install_CmdStan.sh
Last active June 18, 2024 11:40
CmdStan installation script for Debian Linux
#!/bin/bash
#
# Linux installation script for CmdStan (http://mc-stan.org/)
# Downloads and installs CmdStan on DEBIAN/UBUNTU LINUX
# The following shell commands will be created (/usr/bin/...):
# stanc
# stan_make
# stan_print
#
# Please adapt VERSION number!
#This shows how to get the random slopes and CI's for each level in a hierarchical model
#dataset used
head(iris)
#what we want to investigate
#Is there a general relationship? and how it differs by species
plot(iris$Sepal.Width ~ iris$Petal.Width, col = iris$Species, las =1)
#Our model with random slope and intercept
@lindemann09
lindemann09 / install_jasp.sh
Last active August 29, 2015 14:22
JASP installation script for Debian & Ubuntu linux
echo "This script is deprecated!"
echo "Please visit http://lindemann09.github.io/jasp-linux-install/"