Skip to content

Instantly share code, notes, and snippets.

View sampottinger's full-sized avatar

A Samuel Pottinger sampottinger

View GitHub Profile
@sampottinger
sampottinger / model.py
Last active March 3, 2025 21:55
Example from Lecture 11 using Sketchingpy which draws dev satisfaction from Stack Overflow Developer Survey by age.
"""Data model for a Stack Overflow Dev Satisfaction visualization.
Author: A Samuel Pottinger
License: BSD-3-Clause
"""
import functools
class Dataset:
@sampottinger
sampottinger / tutorial_11.py
Last active February 25, 2025 23:32
Graphic depicting change in fuel standards over time.
"""Graphic depicting change in fuel standards over time.
Graphic depicting change in fuel standards over time using the data first
provided in "Fuel Economy Standards for Autos" by New York Times, 1978.
Part of https://interactivedatascience.courses.
Author: A Samuel Pottinger
License: BSD-3-Clause
"""
@sampottinger
sampottinger / tutorial_10_2.py
Last active February 25, 2025 19:54
Simulation which rotates wheels of colors to combine channels.
"""Simulation which rotates wheels of colors to combine channels.
Simulation which rotates wheels with one wheel per color channel (red, green,
blue). These wheels overlap to show combinations of colors.
Part of https://interactivedatascience.courses.
Author: A Samuel Pottinger
License: BSD-3-Clause
"""
@sampottinger
sampottinger / tutorial_10_1.py
Last active February 25, 2025 19:54
Simulation which rotates wheels of colors to combine channels.
"""Simulation which rotates wheels of colors to combine channels.
Simulation which rotates wheels with one wheel per color channel (red, green,
blue). These wheels overlap to show combinations of colors.
Part of https://interactivedatascience.courses.
Author: A Samuel Pottinger
License: BSD-3-Clause
"""
"""Simulation of bouncing balls with user interaction.
Simulation of bouncing balls with user interaction as an example for
interactivedatascience.courses as part of Tutorial 3.
License: BSD-3-Clause
Author: A Samuel Pottinger
"""
import sketchingpy
# Example for interactivedatascience.courses
# Simulation of bouncing balls with user interaction.
# License: BSD-3-Clause
# Author: A Samuel Pottinger
import sketchingpy
import time
WIDTH = 500 # pixels
HEIGHT = 400 # pixels
# Example for interactivedatascience.courses
# Simulation of bouncing balls without user interaction.
# License: BSD-3-Clause
# Author: A Samuel Pottinger
import sketchingpy
import time
WIDTH = 500 # pixels
HEIGHT = 400 # pixels
# Example for interactivedatascience.courses
# Draws from the center of a drawing to the user's cursor.
# Author: A Samuel Pottinger
# License: BSD-3-Clause
import sketchingpy
import time
sketch = sketchingpy.Sketch2D(500, 400)
# Example for interactivedatascience.courses
# Draws a line that responds to time.
# Author: A Samuel Pottinger
# License: BSD-3-Clause
import sketchingpy
import time
sketch = sketchingpy.Sketch2D(500, 400)
# Setup a new VM (like gitpod) for building Processing-java
# Released under MIT license
yes | sudo apt-get install rsync
cd /tmp
wget https://dlcdn.apache.org//ant/binaries/apache-ant-1.10.12-bin.zip
unzip apache-ant-1.10.12-bin.zip
wget https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.5%2B8/OpenJDK17U-jdk_x64_linux_hotspot_17.0.5_8.tar.gz
tar -xvf OpenJDK17U-jdk_x64_linux_hotspot_17.0.5_8.tar.gz
mv jdk-17.0.5+8/ ~