Skip to content

Instantly share code, notes, and snippets.

View ProfAvery's full-sized avatar

Kenytt Avery ProfAvery

  • California State University, Fullerton
  • Fullerton, CA
View GitHub Profile
@ProfAvery
ProfAvery / hello-c.ex_
Last active October 8, 2024 17:55
CPSC 458 - Harmless .exe files for basic static analysis
@ProfAvery
ProfAvery / even-ones-3.cnf
Last active October 8, 2024 17:56
California State University, Fullerton - CPSC 439 - Theory of Computation
p cnf 11 22
c DIMACS version of
c https://github.com/sahands/simple-sat/blob/master/src/tests/fsm/even-ones-3.in
c No more than one state at each step
-1 -2 0
-3 -4 0
-5 -6 0
-7 -8 0
@ProfAvery
ProfAvery / Makefile
Created March 11, 2022 04:51
CPSC 439 - Spring 2022 - Week 6 - List-of-tuples Representation
CXXFLAGS = -g -std=c++17 -Wall -Wextra -Wpedantic -Werror
.PHONY: clean
run: test
./test
test: test.cpp nand-circ.h
$(CXX) $(CXXFLAGS) $< -o $@
@ProfAvery
ProfAvery / desugar.cpp
Last active October 8, 2024 17:56
CPSC 439 - Spring 2022 - Week 5 - NAND-CIRC-IF
#include <iostream>
/*
C++ version of
https://nbviewer.org/github/boazbk/tcscode/blob/master/Chap_04_Syntactic_Sugar.ipynb#Even-more-sugar
*/
using std::cout;
using std::endl;
using std::string;
@ProfAvery
ProfAvery / Makefile
Created December 8, 2021 05:30
C++ variants of Figures 29.1, 29.2, and 29.4
CXXFLAGS = -g -std=c++17 -Wall -Wextra -Wpedantic -Werror -pthread #-fsanitize=thread
SRCS = no-lock-no-threads.cpp \
lock-no-threads.cpp \
single-lock-threaded.cpp \
multiple-lock-threaded.cpp \
approximate.cpp
TARGETS = $(SRCS:.cpp=)
.PHONY: clean
@ProfAvery
ProfAvery / coalesce.cpp
Created November 11, 2021 00:29
CPSC 351 - Fall 2021 - Project 2 - Test Case 2
#include <cstdlib>
#include <cstddef>
#include <cassert>
#include <iostream>
#include "allocator.h"
using std::byte;
using std::cout;
@ProfAvery
ProfAvery / toomuch.cpp
Created November 11, 2021 00:26
CPSC 351 - Fall 2021 - Project 2 - Test Case 1
#include <cstdlib>
#include <cstddef>
#include <cassert>
#include <iostream>
#include "allocator.h"
using std::byte;
using std::cout;
@ProfAvery
ProfAvery / Makefile
Last active November 22, 2021 01:00
C++ variant of threads-intro/t1.c (Figure 26.6)
CXXFLAGS = -g -std=c++17 -Wall -Wextra -Wpedantic -Werror -pthread
all: t1 t1-sanitized
# Note: using implicit rule for .cpp files to create t1
t1-sanitized: t1.cpp
$(CXX) $(CXXFLAGS) -o $@ $^ -fsanitize=thread
.PHONY: clean
@ProfAvery
ProfAvery / server.py
Created September 8, 2021 23:08
Python http.server.BaseHTTPRequestHandler example
#!/usr/bin/env python3
# Example HTTP server
#
# See <https://docs.python.org/3/library/http.server.html> for details
#
import http.server
import socketserver
@ProfAvery
ProfAvery / Makefile
Last active August 31, 2021 23:23
C++ variant of cpu-api/p4.c (Figure 5.4)
CXXFLAGS = -g -std=c++17 -Wall -Wextra -Wpedantic -Werror
all: p4
# Note: using implicit rule for .cpp files to create p4
.PHONY: clean test
test: p4
./p4 && cat p4.output