Skip to content

Instantly share code, notes, and snippets.

View acbart's full-sized avatar

Austin Cory Bart acbart

View GitHub Profile
@acbart
acbart / heart.py
Created September 1, 2022 14:34
heart.py
# -*- coding: utf-8 -*-
"""
This program draws a heart using MatPlotLib.
You don't have to worry about how it does it, just
make sure that it runs. If it's successful, a heart
will appear in a new window.
"""
# Import graphing library
@acbart
acbart / trace_test.py
Created August 19, 2022 19:29
Trace a program, determine when a class vs function is being entered
import sys
import os
import builtins
build_class_orig = __build_class__
class Tracer:
def __init__(self, code, filename):
self.code = code
self.filename = filename
@acbart
acbart / mutable_data_examples.py
Created August 14, 2022 15:54
Mutable Data Code from CS1 Bakery Assignment
# Comment out each section's triple quotes to show or hide them!
"""
def double(number: int) -> int:
new_number = number * 2
return new_number
def double_mutate(number: int) -> int:
number = number * 2
return number
@acbart
acbart / vip_ideas.md
Last active August 13, 2022 15:40
Vague Project ideas for the Digital Education VIP F22

These are some vague ideas for projects I am working on or starting, and could use some interested students to engage with!

Apply at: https://vip.udel.edu/projects/Digital-Education

  1. Canvas extensions via Userscript, many ways we can do more here: https://github.com/UD-CIS-Teaching/more-canvas-tools/
  2. Extending, documenting, testing, building out the Pedal project (sophisticated autograding framework): https://pedal-edu.github.io/
  3. Game development library for CS1, meant to be truly novice friendly: https://designer-edu.github.io/
  4. Analyzing the huge quantity of autograding data from CISC108 that I've collected over the years and utterly failed to capitalize on correctly.
  5. Properly dockerizing BlockPy so that it's much easier for others to use
  6. Porting over the CT@VT curriculum to use BlockPy more extensively: https://ct-vt.github.io/

A.6.2. Code - Complex Formula: Write print statements that print the result of some complex formula bakery_intro_math_code_complex_formula

A.7.1. Code - Print Logic: Write print statements that print the result of basic logical comparisons bakery_intro_logic_code_print_logic

A.8.1. Code - Quick Calculation: Evaluate some simple math expressions bakery_intro_eval_code_quick_calc

B.1.1. Code - Print Variable: Write a program that assigns integer values, string values, and boolean values to a variable and then prints the value of the variables. Gives some as an example. bakery_intro_variables_code_print_variables

@acbart
acbart / middle_function.py
Created August 12, 2022 17:27
Middle Function Example
from bakery import assert_equal
def middle(text: str, length: int) -> str:
""" Determine the middle character of a string """
index = length // 2
letter = text[index]
return letter
assert_equal(middle("Hello", 5), "l")
assert_equal(middle("Frog", 4), "o")
@acbart
acbart / tracing_ifs_example_vehicles.py
Created August 12, 2022 16:07
Tracing Ifs Example Vehicles
travellers = 4
suitcases = 3
bookbags = 2
def choose_vehicle(travellers: int, bags: int) -> str:
space = bags // 2 + travellers
if space > 4:
return 'van'
elif space <= 1:
return 'bike'
@acbart
acbart / spread_submission.js
Last active July 21, 2022 21:27
Parses uploaded submissions on Canvas to determine group mates, and then resubmits on the students' behalf.
$.getMultiScripts=function(arr,path){function executeInOrder(scr,code,resolve){
scr==arr[0]?(arr.shift(),eval(code),resolve(),console.log("executed",scr)):
setTimeout(function(){executeInOrder(scr,code,resolve)},50)}
var _arr=$.map(arr,function(e){return new Promise(r=>{jQuery.ajax({
type:"GET",url:(path||"")+e,dataType:"text",success:function(c){
console.log("loaded ",e),executeInOrder(e,c,r)},cache:!0})})});
return _arr.push($.Deferred(function(e){$(e.resolve)})),
$.when.apply($,_arr)};
// Load ChartJS
@acbart
acbart / canvas_tools.py
Last active September 12, 2023 22:29
Canvas Utilities for Python
"""
This file has a bunch of useful helper functions that can make it a bit easier to access the Canvas API.
It's grown organically, so it is not always very easy to read.
There are Canvas libraries out there for Python! They might be better, I haven't tried them.
The first time you import this library, it will load a settings file (`settings.yaml`). If the file
does not exist, then it will be created with some of the expected fields. An example of what the file
might look like is below. You will need to be sure to update it with:
@acbart
acbart / gist:894c08b9ef636507d9e5363347fc332d
Last active March 12, 2022 17:36
0 credit courses at UD in F21
code title
454 ADMN561011 GRADUATE CONTRACT: GRADUATE ASSISTANT
455 ADMN561012 GRADUATE CONTRACT: RESEARCH ASSISTANT
456 ADMN561013 GRADUATE CONTRACT: TEACHING ASSISTANT
457 ADMN561014 GRADUATE CONTRACT: GRADUATE FELLOW
478 ADMN561015 GRADUATE CONTRACT: TUITION SCHOLAR
783 AFSC150010L Initial Military Training I
785 AFSC250010L Field Training Preparation I
813 AFSC350010L Intermediate Cadet Leader Training I
815 AFSC450010L Senior Cadet Leader Training I