Skip to content

Instantly share code, notes, and snippets.

View switchswap's full-sized avatar
🎷
Jazz for your soul!

Swap switchswap

🎷
Jazz for your soul!
View GitHub Profile
@switchswap
switchswap / glyphs.pde
Created August 5, 2021 07:57
Progamatic Glyphs
void drawGlyph(int startX, int startY, int stepSize) {
for (int i = 0; i < 3; i++) {
for (int j = 0; j < 3; j++) {
int orientation = int(random(2));
int currX = startX + (i * stepSize);
int currY = startY + (j * stepSize);
if (orientation == 0) {
// Draw left diagonal
line(currX, currY, currX + stepSize, currY + stepSize);
}
@switchswap
switchswap / graph.py
Last active October 25, 2020 06:34
CPU Scheduler Gantt Chart Creator
import re
import random
import numpy as np
import matplotlib.pyplot as plt
input_filename = "data.txt"
output_filename = "output.png"
procs = []
proc_num = 0
@switchswap
switchswap / THEMING.md
Created June 15, 2020 21:05
AniTrend Theme-ing Guide (For v1.6.8)

AniTrend Theme-ing Guide (For v1.6.8)


Prerequisites

  1. Android Studio
  2. A cloned version of AniTrend
  3. Knowing how to run your own build of AniTrend

How to make a theme

Define your colors

  • Primary color
@switchswap
switchswap / minheap.hpp
Created April 2, 2019 04:01
N-ary Min Heap
#ifndef MINHEAP_H
#define MINHEAP_H
#include <vector>
#include <utility>
#include <stdexcept>
template <class T>
class MinHeap {
public:
@switchswap
switchswap / msort.hpp
Last active April 2, 2019 03:59
K-way Templated Merge Sort
#ifndef MSORT_H
#define MSORT_H
#include <vector>
#include <utility>
template <class T, class Comparator>
void mergeSort(std::vector<T>& myArray, int k, Comparator comp) {
mergeHelper(myArray, k, comp, 0, (int)myArray.size()-1);
}