Skip to content

Instantly share code, notes, and snippets.

title This is a test to show that gists can work!
author My Name Here
homepage www.puzzlescript.net
========
OBJECTS
========
Background
green
@thomaswp
thomaswp / 1-1000.txt
Last active September 8, 2021 13:25 — forked from deekayen/1-1000.txt
1,000 most common US English words
find
any
new
work
part
take
get
place
made
live
@thomaswp
thomaswp / README.md
Last active April 12, 2019 18:48
Snap Datashop Format

Datasets

This data contains detailed log data of students' use of the iSnap programming environment for an introductory undergraduate computing course for non-majors. The course content focused on computer applications, but also included a once-per-week lab section where students learned to program, using a curriculum loosely based on the Beauty and Joy of Computing. The data includes data from both in-lab assignments, where students worked in the lab sections with a TA available for help, and independent homework assignments.

Assignments

Datasets contain data from the following assignments:

Lights, Camera Action (Homework)

JSON-AST Format

Purpose

The purpose of this format is to provide a language-agnostic way of representing source code that can be compiled to an Abstract Syntax Tree (AST). The format is represented using JSON and should be able to capture the important properties of most code.

Format

All code in these datasets are represented as abstract syntax trees (ASTs), stored in a JSON format. Each JSON object represents a node in the AST, and has the following properties:

  • type [required]: The type of the node (e.g. "if-statement", "expression", "variable-declaration", etc.). In Snap, this could be the name of a built-in block (e.g. "forward", "turn"). The set of possible types is pre-defined by a given programming language, as they generally correspond to keywords. The possible types for a given language are defined in the grammar file for the dataset, discussed later.
  • value [optional]: This contains any user-defined value for the node, such as the identifier for a variable or function, the value of a
# Generates an array of arrays of arguments to a prop test to check it
chiSqTest <- function(n) {
# Set seed for consistency
set.seed(1234)
# Generate n (counts), p (proportions) and s (successes)
n1s <- round(runif(n, 80, 120))
n2s <- round(runif(n, 80, 120))
p1s <- round(c(runif(n / 2, 0, 0.5), runif(n / 2, 0.5, 1)), 3)
p2s <- round(c(runif(n / 2, 0, 0.5), runif(n / 2, 0.5, 1)), 3)
import java.util.Scanner;
import com.github.scribejava.core.builder.ServiceBuilder;
import com.github.scribejava.core.builder.api.DefaultApi10a;
import com.github.scribejava.core.model.OAuth1AccessToken;
import com.github.scribejava.core.model.OAuth1RequestToken;
import com.github.scribejava.core.model.OAuthRequest;
import com.github.scribejava.core.model.Response;
import com.github.scribejava.core.model.Verb;
import com.github.scribejava.core.oauth.OAuth10aService;
@thomaswp
thomaswp / Area.m
Created July 10, 2013 16:43
Xcode Hang Problem Code
//
// Generated by the J2ObjC translator. DO NOT EDIT!
// source: pythagoras/f/Area.java
//
// Created by Thomas on 7/10/13.
//
#import "IOSClass.h"
#import "IOSFloatArray.h"
#import "IOSIntArray.h"
@thomaswp
thomaswp / gist:5816085
Last active December 18, 2015 17:09
Generic equals and hashCode implementation.
public class HashCode {
private final static int prime = 31;
private int result = 1;
private Hashable hashable;
private boolean inHash;
private boolean inLeftEquals;
private boolean inRightEquals;
private Object lastObject;