Skip to content

Instantly share code, notes, and snippets.

View rbohrer's full-sized avatar

Rose Bohrer rbohrer

  • Worcester Polytechnic Institute
  • Worcester, MA
View GitHub Profile
@rbohrer
rbohrer / example.src.AnnotateExample.scala
Created June 5, 2020 14:41
Incremental compilation error with macros and inheritance
package example
import macros.Annotate
import InheritExample._
object AnnotateExample extends AnnotateExampleTrait
trait AnnotateExampleTrait {
@Annotate()
val integer: Int = 9
@rbohrer
rbohrer / TODO list
Created May 2, 2014 17:16
Cherie dot Brandon's adorable couple todo list
Make a wobsite (in Perl)
Binary trees in Agda (Cherie's Garden)
- Naive
- AVL
- Treaps
- Red-Black
- Splay
- 1-2 Brother
Compression (and depression) algorithms in C/Rust:
- GIF (LZW)
@rbohrer
rbohrer / gist:3167777
Created July 24, 2012 03:03
A fuzzer for Scheme compilers/interpreters that generates test programs via macros.
;; Fuzzer configuration
;; A good seed for crashing during code generation: 1343186061
(define seed (current-time)) ; current-time is Guile-specific (RNG seed)
(define max-items 10000) ; Maximum number of list elements in the output program
(define max-int (expt 2 30)) ; Largest int to appear in any math expression
(define branch-factor 100) ; Most arguments to a math expression
;; Random number generator - Numerical Recipes LCG
(define (rand-int mod)
(let ((a 1664525)
# The subgrid of grid starting at x,y
def sub_grid(grid,x,y):
res = []
rows = grid[y:y+3]
for i in range(len(rows)):
res += rows[i][x:x+3]
return res
# i'th column of grid
# Use a different solved board to generate different tests.
valid = [[5,3,4,6,7,8,9,1,2],
[6,7,2,1,9,5,3,4,8],
[1,9,8,3,4,2,5,6,7],
[8,5,9,7,6,1,4,2,3],
[4,2,6,8,5,3,7,9,1],
[7,1,3,9,2,4,8,5,6],
[9,6,1,5,3,7,2,8,4],
[2,8,7,4,1,9,6,3,5],
[3,4,5,2,8,6,1,7,9]]