Skip to content

Instantly share code, notes, and snippets.

View Andrew-William-Smith's full-sized avatar

Andrew Smith Andrew-William-Smith

View GitHub Profile
@Andrew-William-Smith
Andrew-William-Smith / dream.ipynb
Created May 7, 2017 16:29
The standard Google DeepDream notebook, modified to run under Python 3
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Andrew-William-Smith
Andrew-William-Smith / luminance-plot.py
Created August 23, 2017 19:00
A script to map the luminance values of image pixels into three-dimensional space.
from PIL import Image
import sys
def rgb2hex(r, g, b):
return '#{:02x}{:02x}{:02x}'.format(r, g, b)
def printError(err):
print(err)
sys.exit(1)
@Andrew-William-Smith
Andrew-William-Smith / pathFollow.py
Created May 18, 2018 22:10
Autonomous nanoquad navigation of arbitrary paths
"""Andrew S 18 May 2018
"Autonomous nanoquad navigation of arbitrary paths"
Information Engineering, St. Mark's School of Texas
Abstract: This program uses machine vision to allow a nanoquad to trace an arbitrary path,
defined in a certain colour."""
import cv2
import logging
import math
@Andrew-William-Smith
Andrew-William-Smith / AllocationMeasurement.java
Created September 4, 2018 19:03
Allocation time measurement of simple Java data types
import java.io.FileWriter;
import java.io.IOException;
public class AllocationMeasurement {
public static void main(String[] args) {
try {
FileWriter csv = new FileWriter("mem.csv");
csv.write("Array length,Byte,Short,Int,Long,Object reference" + System.lineSeparator());
for (int i = 0; i < 30000; i += 10) {
@Andrew-William-Smith
Andrew-William-Smith / CrazyflieCommander.py
Last active January 15, 2019 19:37
A simple library to control Crazyflie 2.0 quadcopters asynchronously
# -*- coding: utf-8 -*-
#
# CRAZYFLIE COMMANDER LIBRARY
# Copyright (C) 2019 Andrew William Lawrence Smith
# Written for St. Mark's School of Texas --- Courage and Honor
#
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
@Andrew-William-Smith
Andrew-William-Smith / NQueensGenerator.java
Created March 12, 2020 21:14
A simple program to generate an iterative solver for the N-queens problem
/* N-Queens non-recursive code generator
* Andrew Smith, UT Computer Science 2022
* [email protected]
*
* LICENSE:
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
@Andrew-William-Smith
Andrew-William-Smith / README.md
Last active September 4, 2020 02:41
Simple script to create breakout rooms and assign scribes for discussion sections.

Discussion Section Breakout Room Assignments

This script generates evenly-distributed breakout rooms for course discussion sections, in addition to appointing scribes for each section in round-robin style. It was intended for the discussion section model we use in CS 314, although it can be applied to any course with little or no modification.

Setup instructions

Download the script breakout.py to a file on your machine, or clone this gist to a local directory. In the same directory, create a file named students.csv containing each student's information in the following format:

Student 1 Name,student1eid,0
Student 2 Name,student2eid,0
@Andrew-William-Smith
Andrew-William-Smith / test.c
Created January 8, 2021 20:32
A very simple generic vector in C, with unit tests. Written for the tutorial series "C for Java Programmers".
#include "test.h"
#include "vector.h"
#pragma FIXTURE_START
FIXTURE(Vector_fixture) {
struct vector vec;
};
FIXTURE_SETUP(Vector_fixture) {
@Andrew-William-Smith
Andrew-William-Smith / FactbookValidator.java
Created April 28, 2021 16:12
A simple utility to verify the downloaded CIA Factbook file for the Huffman assignment.
import java.io.BufferedInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.security.DigestInputStream;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.Arrays;
import javax.swing.JFileChooser;
@Andrew-William-Smith
Andrew-William-Smith / iosevka-collegiate-bold.ttf
Last active January 10, 2023 07:28
A compiled version of Iosevka Collegiate, a customised build of the Iosevka font.
This file has been truncated, but you can view the full file.