####0. Install Xcode
You probably have his already, but if not, get it.
####1. Download Anaconda Python Distribution
This is how they describe it:
Completely free enterprise-ready Python distribution for large-scale data processing, predictive analytics, and scientific computing
The download link is here.
I tried using the preinstalled version of python on my mac and had issues. This installation seemed to solve that.
####2. Get PsiTurk Running 2. Install PsiTurk
Follow the directions on the PsiTurk site. I would agree with their statement that:
The easiest way to install psiTurk is via
pip
.
- Set Up Amazon Mechanical Turk
There are basically two things you need here. * An active account at Amazon Web Services (you will need your credit card for this). * An active requester account at Mechanical Turk.
The directions on the PsiTurk site walk you through this.
- Set up PsiTurk
Directions are here.
Remember to update the ~/.psiturkconfig
file with BOTH your Amazon credentials and your PsiTurk credentials.
- Run PsiTurk Example
Now you can run the example. Directions on doing that here.
####3. Install Processing
Note: This is required to adapt this particular bandit experiment, as I built it in Processing since my JavaScript skills don't exist (yet). Processing can publish to Javascript, but it definitely makes implementing the project with PsiTurk more cumbersome. If you can work in Javascript, do that.
Here is some info specifically on working with Processing and JavaScript.
In terms of passing information FROM the processing sketch to JavaScript I found this page helpful. Specifically this code:
10 function bindJavascript() {
11 var pjs = Processing.getInstanceById('mysketch3');
12 if(pjs!=null) {
13 pjs.bindJavascript(this);
14 bound = true; }
15 if(!bound) setTimeout(bindJavascript, 250);
16 }
17 bindJavascript();
18
19 function showXYCoordinates(x, y) {
20 document.getElementById('xcoord').value = x;
21 document.getElementById('ycoord').value = y;
22 }
I just ended up inserting this into a script tag in the exp.html
file.
Also to note is that you will want to put the contents of the Processing web-export
folder (see image)
into your PsiTurk's project's static>js filepath.
You will also need to steal some code from the index.html
file in the Processing web-export
folder to insert into the exp.html
file in your PsiTurk project to pull the Processing sketch in.
####4. Create Database
I experienced a minor nightmare moving from SQLite (which is the default database) to MySQL. However following these installation instructions seemed to (mostly) fix things.
The remaining error I got after this was related to the files libssl.1.0.0.dylib
and libcrypto.1.0.0.dylib
. Finally I found some info on what to do here. I couldn't get the command line prompts to work for some reason but just copied the new files to the filepath where they were missing (as per the error message).
####5. Test Experiment
About to do this, will update once complete.