Based on initial version by Tom Isaacson (@parsley72).
Learn more about tracking geo coordinates in your own projects here.
############################################################################ | |
# # | |
# Excluding participants who participated in previous studies # | |
# By Arnoud Plantinga, based on Gabriele Paolacci's Excel solution # | |
# # | |
# Instructions (Note: edit only the non-indented lines): # | |
# # | |
# 1. Create a qualification (e.g., "Study 1"; keep in mind that the name # | |
# will be visible to Workers) in MTurk/Manage/Qualification Types # | |
# # |
class RunningStat(object): | |
""" | |
Based on ideas presented in | |
1. Numerically Stable, Single-Pass, Parallel Statistics Algorithms - http://www.janinebennett.org/index_files/ParallelStatisticsAlgorithms.pdf | |
2. Accurately computing running variance - http://www.johndcook.com/standard_deviation.html | |
""" | |
def __init__(self): | |
self.m_n = 0 | |
self.m_oldM = 0 |
cSplit <- function(indt, splitCols, sep = ",", direction = "wide", | |
makeEqual = NULL, fixed = TRUE, drop = TRUE, | |
stripWhite = FALSE) { | |
message("`cSplit` is now part of the 'splitstackshape' package (V1.4.0)") | |
## requires data.table >= 1.8.11 | |
require(data.table) | |
if (!is.data.table(indt)) setDT(indt) | |
if (is.numeric(splitCols)) splitCols <- names(indt)[splitCols] | |
if (any(!vapply(indt[, splitCols, with = FALSE], | |
is.character, logical(1L)))) { |
Based on initial version by Tom Isaacson (@parsley72).
Learn more about tracking geo coordinates in your own projects here.
function map() { | |
emit(1, { | |
sum: this.value, // the field you want stats for | |
min: this.value, | |
max: this.value, | |
count: 1, | |
diff: 0 | |
}); | |
} |
/** | |
* An AngularJS directive for Dropzone.js, http://www.dropzonejs.com/ | |
* | |
* Usage: | |
* | |
* <div ng-app="app" ng-controller="SomeCtrl"> | |
* <button dropzone="dropzoneConfig"> | |
* Drag and drop files here or click to upload | |
* </button> | |
* </div> |
bigcorPar <- function(x, nblocks = 10, verbose = TRUE, ncore="all", ...){ | |
library(ff, quietly = TRUE) | |
require(doMC) | |
if(ncore=="all"){ | |
ncore = multicore:::detectCores() | |
registerDoMC(cores = ncore) | |
} else{ | |
registerDoMC(cores = ncore) | |
} |
<?php | |
header('Content-Type: text/html; charset=utf-8'); | |
/** | |
* Download the currecy data from the link below, and place it along side this file | |
* @link http://www.currency-iso.org/en/home/tables/table-a1.html Current currency & funds code list | |
*/ | |
$xml = file_get_contents( dirname(__FILE__) . '/dl_iso_table_a1.xml'); | |
$currencyArray = json_decode(json_encode((array) simplexml_load_string($xml)), 1); |
<?php | |
if (!function_exists('apache_request_headers')) { | |
function apache_request_headers() { | |
foreach($_SERVER as $key=>$value) { | |
if (substr($key,0,5)=="HTTP_") { | |
$key=str_replace(" ","-",ucwords(str_replace("_"," ",substr($key,5)))); | |
$out[$key]=$value; | |
} | |
} | |
return $out; |
var my_element = document.getElementById('my-element'); | |
//-- Returns true/false | |
my_element.isVisible(my_element); |