Skip to content

Instantly share code, notes, and snippets.

View acbart's full-sized avatar

Austin Cory Bart acbart

View GitHub Profile
def provide_world(f):
"""
Creates a new route for the URL endpoint `path`. This decorator wraps
the View endpoint to pass in the current `world` (deserialized from session data
upon function entrance and serialized back into session once the function is
done), any URL parameters, and then any request parameters (sorted by key name).
"""
@wraps(f)
def decorated_function(*args, **kwargs):
world = json.loads(session.get('world', json.dumps(INITIAL_WORLD)))
@acbart
acbart / remap_blockpy_sneks_problems.js
Created August 18, 2019 19:58
Quick snippet to fix most of the programming problems in S19 Sneks curriculum
(function() {
// These are the parameters to modify
const BLOCKPY_ASSIGNMENT_URL = "https://gold.cis.udel.edu/blockpy/assignments/load?assignment_group_url=";
const SNEKS_CURRICULUM_REMAP = {
"Programming 1- Maze Game": "maze",
"Programming 3- Try BlockPy": "sneks_try_blockpy",
"Programming 6- Console IO": "sneks_console_io",
"Programming 8- Types": "sneks_values",
"Programming 9- Arithmetic": "sneks_arithmetic",
@acbart
acbart / ClassConduct.md
Created July 28, 2019 00:40 — forked from evanpeck/ClassConduct.md
A code of conduct that is inserted into the syllabus of CS courses. I'd love to improve it + make it more actionable. Don't hesitate to suggest changes!

Code of Conduct

You have two primary responsibilities:

  • Promote an inclusive, collaborative learning environment.
  • Take action when others do not.

Professionally, we adhere to ACM’s Code of Ethics. More broadly, a course like INSERT COURSE NAME involves reflection, collaboration, and communication. Computer science has a checkered history with respect to inclusion – in corporate environments, in our classrooms, and in the products we create. We strive to promote characteristics of transparency and inclusivity that reflect what we hope our field becomes (and not necessarily what it has been or is now).

We reject behavior that strays into harassment, no matter how mild. Harassment refers to offensive verbal or written comments in reference to gender, sexual orientation, disability, physical appearance, race, or religion; sexual images in public spaces; deliberate intimidation, stalking, following, harassing photography or recording, sustained d

@acbart
acbart / Test Reverse.md
Created February 7, 2019 02:16
Reversed markdown list
  1. first item
  2. second item
  3. another item {: reversed="reversed"}
Write syntactically correct values that incorporate complex expressions
Write syntactically correct literals that compose multiple types
Write syntactically correct String, Float, Integer, Boolean, and None values
Write syntactically correct Lists and Dictionaries literal values
Write statements and expressions that access data in nested data structures
Write simple programs
Write code with branching conditions
Write code that uses functions defined in an external module
Write code that involves simple if statement
Write code that involves nested if statements
SUITS = ['♠', '♦', '♥', '♣']
RANKS = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10']
ALL = [rank+suit for rank in RANKS for suit in SUITS]
def backtrack(a, k):
if is_solution(a):
process_solution(a)
else:
k = k + 1
candidates = construct_candidates(a, k)
@acbart
acbart / settings.yaml
Created August 13, 2018 19:21
Example settings.yaml file
defaults:
canvas-token: "TOKEN"
canvas-url: "https://vt.instructure.com/api/v1/"
canvas-base-url: "https://vt.instructure.com/"
course: f18_ct
courses:
f17_python:
id: 57639
ta_map: "tas/f17_1064_ta_map.yaml"
f18_ct:
@acbart
acbart / pedal_blockpy_example.py
Last active July 17, 2018 20:31
Pedal BlockPy Example
# BlockPy Examples
################################################################################
# Boiler plate code automatically prepended before execution
# Import get_output, set_success, gently, explain
from pedal.report import *
# In JS, patch `get_program`, and then imperative define the report's source
report.set_source(get_program())
# Run the tifa analysis; stuff is automatically added to the report
from pedal.tifa import tifa_analysis()
_tifa = tifa_analysis()
# Adjust this string to have your desired alphabet of letters
alphabet = "ABCDE"
# Adjust this list of strings to have the significantly different pairs
forbidden = ["AD", "AE", "CE", "DE"]
Then run!
def split_bads(universe, bad):
left, right = bad
modified = True
@acbart
acbart / cs1064_worked_examples_data-documentation.json
Last active April 1, 2018 17:48
A description of the fields in the cs1064 WE dataset
# A list of dictionaries, where each dictionary represents a student and their assignment data
# Each user is uniquely defined by a given name, e.g., "Abomasnow"
# Each assignment's name is the human readable assignment name, e.g., "#43.4) Multiple Returns"
# The "events" key maps to a list of the student's events, given as a list of 4 values.
# The integer timestamp is an epoch time; note that some events trigger at the exact same time.
# Here are some common event/action types:
# code/set is when a student edits their code
# editor/run is when a student runs their code
# editor/reset is when they reset their code, and there's other editor/<Something> actions too
# feedback/<Something> is the specific kind of feedback that the student received