Skip to content

Instantly share code, notes, and snippets.

View chris373's full-sized avatar

chris373 chris373

  • Lexington KY area
View GitHub Profile
@chris373
chris373 / kruskal.java
Created May 26, 2017 16:23
Kruskal Algorithm
package com.mygdx.game;
import com.badlogic.gdx.math.Vector2;
import com.badlogic.gdx.utils.ShortArray;
import java.util.*;
public class KruskalAlgorithm {
public Vector2[] kruskal_from_triangles(ShortArray triangles, float[] points) {
[Desktop Entry]
Name=MyScript
GenericName=wallpapers
Comment=change wallpapers every 30 seconds
Exec=/home/chris/wallpapers/background.sh
Terminal=false
Type=Application
X-GNOME-Autostart-enabled=true
while true; do
p='/home/chris/wallpapers/';
r=$(ls /home/chris/wallpapers | shuf -n 1);
gsettings set org.gnome.desktop.background picture-uri 'file://'$p$r;
sleep 30;
done
@chris373
chris373 / MicViz.html
Created June 18, 2016 01:56
Microphone level visualizer based on code from https://codepen.io/zapplebee/pen/gbNbZE
<html>
<!-- Based on the code listed on this code pen project: https://codepen.io/zapplebee/pen/gbNbZE -->
<svg preserveAspectRatio="none" id="visualizer" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<defs>
<mask id="mask">
<g id="maskGroup">
</g>
</mask>
@chris373
chris373 / hackingGame.py
Created June 11, 2015 20:22
FalloutHackingGame
import random
# read in words from the text file
f = open('C:\Users\Chris\Downloads\words.txt')
words = f.read()
f.close()
# get a list of words by splitting at each new line
# sort by length
words = words.split('\n')
@chris373
chris373 / avlTree.java
Last active August 19, 2016 14:38
AVL Tree
/* ------------- needed modifications : -----------------------
* store the the balance factor at each node
* must be entirely independan
* do the function parameters make sense ?
* improve readability
*/
import java.util.*;
import java.io.*;
@chris373
chris373 / Euler36.py
Last active August 29, 2015 14:01
Brute force solution to ProjectEuler.net question 36
'''
Double-base palindromes
Problem 36
The decimal number, 585 = 10010010012 (binary), is palindromic in both bases.
Find the sum of all numbers, less than one million, which are palindromic in base 10 and base 2.
(Please note that the palindromic number, in either base, may not include leading zeros.)
'''