Skip to content

Instantly share code, notes, and snippets.

View boingboomtschak's full-sized avatar
🌎
code-switching with the best of them

Devon boingboomtschak

🌎
code-switching with the best of them
View GitHub Profile
@boingboomtschak
boingboomtschak / parallel-code-to-game-writeup.md
Last active October 1, 2024 23:04
Parallel Game-to-Code Writeup

Parallel (Game-to-Code Tools)

Processing Steps

  • Reading level and optional snapshot file
  • Creating map of level grid from file data
  • Processing level components
  • Finding thread paths
  • Creating graphs from thread paths
  • Creating semaphore and shared value declarations

Integrating Vulkan C++ Code with Flutter on Android

Vulkan source setup

Converting CL kernel to SPV

To convert OpenCL kernels to valid SPIR-V code, we use Clspv. Note that compiling code using atomics requires OpenCL 2.0, which is the reason for the extra flags used below.

clspv kernel.cl -cl-std=CL2.0 -inline-entry-points -o kernel.spv
@boingboomtschak
boingboomtschak / hw1_pt1.py
Last active November 8, 2022 06:09
Graduate compilers assignments, fall quarter 2022
'''
Using PLY to parse a simple language with symbol table for variable assignments.
'''
from re import L
import ply.lex as lex
import ply.yacc as yacc
class SymbolTableException(Exception):
pass

Abstract Data Types (ADTs)

Abstract data types are logical interfaces that we use to describe data structures. They have certain methods and behaviors that are included in their definition, and we often implement them using simpler data structures.

In Python, arrays have many of the methods for simple ADTs (stacks, queues, deques) already implemented, so it is possible to use arrays as any of these ADTs.

Below is a list of the ADTs covered in Lab 6 with some basic definitions and use-cases. The ADTs with an asterisk after their name will be especially helpful in Quiz 3, so make sure that you know those well enough.

Stacks*

@boingboomtschak
boingboomtschak / kitty.conf
Last active September 29, 2022 08:35
Kitty terminal setup with Sonoran Gothic colorscheme and other settings
font_family Monocraft
font_size 7.0
cursor none
cursor_shape underline
cursor_underline_thickness 2.0
cursor_blink_interval -1
sync_to_monitor yes
bell_path ~/.local/kitty.app/sounds/ding.wav
remember_window_size no
initial_window_width 110c
@boingboomtschak
boingboomtschak / Sonoran Gothic.colorscheme
Created September 28, 2022 22:52
Konsole colorscheme for Sonoran Gothic
[Background]
Color=36,31,23
[BackgroundFaint]
Color=43,37,27
[BackgroundIntense]
Color=30,25,20
[Color0]
@boingboomtschak
boingboomtschak / sonoran_gothic_alacritty.yml
Created February 18, 2021 18:34
Configuration for the Alacritty terminal with the Sonoran Gothic theme enabled (and some other visual settings)
colors:
primary:
background: "#241F17"
foreground: "#EAF4DE"
normal:
black: "#867F6E"
red: "#EB6F6F"
green: "#669C50"
yellow: "#F2D696"
blue: "#227B4D"
@boingboomtschak
boingboomtschak / sonoran_gothic_vscode.json
Last active February 18, 2021 18:37
Configuration for Visual Studio Code with the Sonoran Gothic theme
{
"window.zoomLevel": 0,
"workbench.colorCustomizations": {
"focusBorder": "#867f6e",
"foreground": "#eaf4de",
"titleBar.activeBackground": "#241f17",
"titleBar.inactiveBackground": "#332c21",
"titleBar.activeForeground": "#eaf4de",
"tab.activeBackground": "#241f17",
"tab.activeForeground": "#eaf4de",
@boingboomtschak
boingboomtschak / pzip.c
Last active February 18, 2021 18:36
A project for CPSC3500 Computing Systems, run-length encoding run in parallel using pthreads, POSIX semaphores
#include <fcntl.h>
#include <pthread.h>
#include <semaphore.h>
#include <stdatomic.h>
#include <stdlib.h>
#include <stdint.h>
#include <stdio.h>
#include <sys/mman.h>
#include <sys/stat.h>
#include <sys/sysinfo.h>

Getting Started with p5.js

Introduction

What is p5.js?

p5.js is an open-source JavaScript library that is used for, in its own words, "creative coding." By including various modules, both included with p5 and other created by the community, one can put together sets of creative sketches. These sketches can play with concepts of visual and audial media such as lighting, color, sound, frequency, 3D objects, typography, physics, image manipulation, perspective, and many more. p5's functionality is also bolstered by an extensive array of external libraries created and supported by members of the community.

p5 is published by the Processing foundation, most well known for their graphical development environment Processing. p5.js is related to Processing and draws inspiration from it, but is not a branch or direct successor of it. While there are certain concepts that carry over, p5 c