Tests:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<meta charset="utf-8"> | |
<title>SVG Swarm</title> | |
<style> | |
svg { | |
position: absolute; | |
top: 0; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"> | |
<title>Simple Molecules</title> | |
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.js"></script> | |
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.geo.js"></script> | |
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.geom.js"></script> | |
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.layout.js"></script> | |
<style type="text/css"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "Untitled Document", | |
"guid": 11, | |
"components": [ | |
{ | |
"type": "DG.GameView", | |
"guid": 101, | |
"componentStorage": { | |
"currentGameName": "CartWeight", | |
"currentGameUrl": "http://localhost:8000/CartWeight/", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
getContext <- function(re, data=sampleData) { | |
reWithContext <- paste0(".{0,10}", re, ".{0,10}") | |
context <- data[grep(reWithContext, data$text, perl=T),] | |
m <- regexpr(reWithContext, context$text, perl=T) | |
cbind(context, data.frame(context=regmatches(context$text, m))) | |
} | |
writeOut <- function(df, fname) { | |
f <- file(fname, 'wt') | |
for (rownum in 1:nrow(df)) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
asciify <- function(text) { | |
text <- stri_trans_general(text, 'Any-Latin') | |
text <- stri_trans_general(text, 'Any-Publishing') | |
text <- stri_trans_general(text, 'Latin-Ascii') | |
text | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Start with a list of endpoints; here we just use all of them | |
endpoints = Run.where("remote_endpoint IS NOT NULL").map &:remote_endpoint | |
select_params = [ | |
{ | |
:embeddable_type => "Embeddable::OpenResponse", | |
:embeddable_table => "embeddable_open_responses", | |
:answer_table => "embeddable_open_response_answers", | |
:question_foreign_key => "open_response_id", | |
:feedback_table => "c_rater_feedback_items", |
OlderNewer