Skip to content

Instantly share code, notes, and snippets.

View jadudm's full-sized avatar

Matthew Jadud jadudm

View GitHub Profile
@jadudm
jadudm / elecrow_config.txt
Created October 20, 2019 21:11 — forked from kaz-yos/elecrow_config.txt
Elecrow 5inch 800x480 LCD configuration for Raspberry Pi (Add to the bottom of /boot/config.txt)
### Elecrow HDMI 5inch 800x480 LCD display
# https://www.amazon.com/Elecrow-Display-Monitor-800x480-Raspberry/dp/B013JECYF2/
# Adopted from the following URL. Modified for clarity and corrections.
# https://www.amazon.com/gp/aw/review/B013JECYF2/R3ZXW0VTV8AEB/ref=cm_cr_dp_mb_rvw_1?ie=UTF8&cursor=1
# DOCUMENTATION > CONFIGURATION > CONFIG-TXT
# https://www.raspberrypi.org/documentation/configuration/config-txt.md
### Display configuration
# hdmi_group: 0 auto-detect from EDID; 1 CEA; 2 DMT
hdmi_group=2
@jadudm
jadudm / exp13-76812.txt
Last active December 24, 2018 22:26
(expt 13 76812)
1647317805867462939215695166383218825478229094532267802721622552268709149403863
90044072372324477071704607304528998294926796288055057876208947683502921313652911
70774053698597882016546934222856929509132694808138896979219612828339409367813052
42659107770497321389715592240616173917116882226381685542310239419801031715810674
41458650353086996850228369304080208257343907156363962968208251483487468460929042
40395818252987873016939869729211366729736582300352174566870129340374130861549950
11075246039736315558824721366555906691060235961582926712616060803959648685990262
73867620973263574522457067093163253647615427965522565270418956058931967700451322
78663567535015616291889225917694715455005888768947873599061161481690855970521135
99901643286079080563004327933271082431900066621278119082474246037519650410682240
@jadudm
jadudm / scopes-base.rkt
Last active December 12, 2018 12:59
Code for asking question on plt-users about macros as scopes.
#lang racket
(require racket/gui)
(require (for-syntax syntax/parse racket/syntax))
(provide (all-defined-out))
(struct agent (id singular plural fields)
#:transparent)
(begin-for-syntax
@jadudm
jadudm / stress-queen.rkt
Created November 5, 2018 14:50
Testing distributed places in Racket on a 256-core machine.
#lang racket
;; Place both files in the same directory, and launch with
;; racket -um stress-queen.rkt
(require racket/place)
(provide main)
(define worker-bee (make-parameter "stress-worker.rkt"))
@jadudm
jadudm / flip.py
Last active November 8, 2017 19:20
Flipping Data between Files on a Micro:Bit
import os
from microbit import *
def init_state():
# Hopefully, this creates zero-length files
# in the filesystem
A_size = 0
B_size = 0
try:
A_size = os.size("A.txt")
@jadudm
jadudm / init.py
Created April 25, 2016 13:52
Exploring timers in OctoPrint
# coding=utf-8 (test git)
from __future__ import absolute_import
import time
import octoprint.plugin
import octoprint.printer
from octoprint.util import RepeatedTimer
import sys
import logging
from octoprint.events import eventManager, Events
@jadudm
jadudm / upper-division-estimates.rkt
Created November 15, 2015 21:40
Upper-division enrollment model (20151115)
(define (new-calc allstu
;; Grad year... for generating new students
;; who will graduate in 2019, by default.
#:grad-year [grad-year 2019]
;; We assume 20 seats per course, default
#:seats-available [seats-available 20]
;; Three upper vision courses per term
#:num-upper-div [num-upper-div 3]
;; Enrollment push from 226 ... represents
;; how many new students enter the pipeline
@jadudm
jadudm / test_alu.c
Created October 14, 2015 00:48
A short program to test the ALU.
#include <stdio.h>
#include "processor.h"
int main () {
int result;
int flag_ndx;
int inputs_ndx;
bool flags[2][6] = {{false, false, false, false, false, false},
{false, false, false, false, true, false }};
@jadudm
jadudm / parameters-02.py
Created October 12, 2015 20:43
A second attempt.
def wrap (o):
return [o]
def unwrap (o):
return o[0]
def set (o, v):
o[0] = v
def And (a, b, out):
@jadudm
jadudm / parameters-01.py
Created October 12, 2015 20:43
Exploring parameters in Python, part 1.
def And (a, b, out):
if (a and b):
out = True
else:
out = False
def main ():
tests = [[False, False], [False, True], [True, False], [True, True]]
r1 = False
r2 = False