Skip to content

Instantly share code, notes, and snippets.

View davepagurek's full-sized avatar

Dave Pagurek davepagurek

View GitHub Profile
adorable
adventurous
aggressive
agreeable
alert
alive
amused
angry
annoyed
annoying
function addExplicitNewlines(
input,
maxWidth,
textCanvas,
font,
size
): string {
const split = ['']
const currentLine = () => split[split.length - 1]
diff --git a/oldsketch.txt b/newsketch.txt
index 96a0e16..a45a764 100755
--- a/oldsketch.txt
+++ b/newsketch.txt
@@ -113,6 +113,13 @@ class Shape {
this.img = random(imgs);
}
this.scale = random(0.2,1.0);
+ this.opacity = random(100, 255)
+
3-D
4-H
a cappella
a gogo
a la carte
a la king
a la mode
a posteriori
a priori
a tempo
@davepagurek
davepagurek / abstraction-proposal.md
Last active April 18, 2018 04:58
Calder abstraction proposal

Calder geometry abstraction proposal: tangible models

Overview

Positions and rotations in 3D space are unintuitive for people who aren't well versed in geometry. Artists are instead more used to thinking about space tangibly. Typically, when making sculpture additively, one will start with an armature, which is a skeleton of the final creation, and then and then attach things to build up the final form. Armatures are posed by holding certain parts and moving others. Pieces are connected to joints.

Armatures

Building armatures

@davepagurek
davepagurek / proposal.md
Last active April 15, 2018 20:19
Calder dsl proposal

Calder Pipeline DSL Proposal

Background

After writing the shader code itself, actually providing the shaders with data and calling them is a difficult process. I call the process of taking information, transforming it, and feeding it to shaders a pipeline. The code for the shaders themselves is not addressed in this proposal.

WebGL rendering is effectively a pure function: it takes some input, and writes to the screen. Since we don't read data back from the screen, this is a unidirectional data flow. It is just a matter of defining the input required for a shader. The Regl library uses this abstraction, calling a render of a shader a command: https://github.com/regl-project/regl/blob/gh-pages/API.md#commands

However, because Regl doesn't parse your shader code, it doesn't know if you filled in all the data the shader needs. The best it can do is have you specify what the shader needs when defining a command, and checking at runtime that you passed in the values you said you would.

<html>
<head>
</head>
<body>
<canvas id="glCanvas" width="640" height="480"></canvas>
<script src="https://cdnjs.cloudflare.com/ajax/libs/gl-matrix/2.4.0/gl-matrix-min.js"></script>
<script type="text/javascript" src="script.js"></script>
</body>
</html>
@davepagurek
davepagurek / install_db2_wrapper.sh
Last active October 12, 2017 01:05
Setup for cs348
#!/usr/bin/env bash
# echo rlwrap
cd ~
git clone https://github.com/hanslub42/rlwrap.git
cd rlwrap
autoreconf --install
./configure --prefix=$HOME
make
make install
@davepagurek
davepagurek / setup.sh
Last active October 10, 2017 04:58
Add arrow keys to db2. Run `db2c`
#!/usr/bin/env bash
# install rlwrap
cd ~
git clone https://github.com/hanslub42/rlwrap.git
cd rlwrap
autoreconf --install
./configure --prefix=$HOME
make
make install
@davepagurek
davepagurek / openletter.md
Last active October 2, 2017 16:23
An open letter to CS247.

Open Letter to CS247

The past two assignments in this course have had what I feel to be significant issues that impede learning. I disagree with the philosophy behind the assignments' design decisions, and I feel like my opinions need to be voiced in order to help improve the quality of the course and, by extension, our education.

Counter-productive requirements

For a course about learning good C++ design, the decision to disallow all of STL, templating, arrays, and multiple files confuses me. The first assignment requires the creation of multiple container types, many of which can have very similar implementations. We are marked on not repeating ourselves, so every student completing this assignment needs to refactor their collections into some sort of heirarchy to achieve this and avoid simply copy-and-pasting code. There are a few ways to do this without using the tools we are restricted from using, and all of them lead to poor C++ code:

  • Void pointer casting: One can make a generic container c