Skip to content

Instantly share code, notes, and snippets.

Avatar

Thomas Moll QuantumFractal

View GitHub Profile
@QuantumFractal
QuantumFractal / TrappedKnights2.ipynb
Last active Feb 20, 2019
Trapped Knights Part 2
View TrappedKnights2.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View gist:ffaa56516ad3f2f1a62e8b0a2fddc632
{
"cells": [
{
"cell_type": "markdown",
"metadata": {
"hide_input": true
},
"source": [
"# The Trapped Knight Problem"
]
View trapped_knight.jl
# ulam spiral
using Crayons.Box
knight_deltas = [(-2, -1), (-2, +1), (+2, -1), (+2, +1), (-1, -2), (-1, +2), (+1, -2), (+1, +2)]
function main()
width, height = 5,5
for y in height:-1:-height
for x in -width:width
#print("(", x, ",", y, ")")
quarter = ulam_quarter(x, y)
View LoadAssets.cs
using UnityEngine;
using System.Collections;
using AssetBundles;
public class LoadAssets : MonoBehaviour
{
public const string AssetBundlesOutputPath = "/AssetBundles/";
public string assetBundleName;
public string assetName;
View 4-bit Block Cipher
""" Scratch file for Crypto.io """
plaintext_space = "0123456789ABCDEF"
key = {'0': 'F', '1': '2', '2': '7', '3': '4',
'4': '5', '5': 'C', '6': '9', '7': 'E',
'8': 'D', '9': '1', 'A': '3', 'B': '6',
'C': '3', 'D': 'A', 'E': 'B', 'F': '0'}
def main():
plaintext = "12B70ADE"
@QuantumFractal
QuantumFractal / Fib.java
Created Nov 10, 2016
Exam 2 Review Code
View Fib.java
package source;
public class Fib {
public static void main(String[] args) {
System.out.println("Total paths given 4 tiles "+countPaths(4));
System.out.println(intPower(2, 16));
}
public static void start(int n ){
View Setup.sh
echo "Setting up Tom's environment please wait..."
eval $(ssh-agent -s)
echo "Setting ssh key..."
ssh-add ~/.ssh/quanta
echo "Finished!"
echo "Setting git settingss..."
git config --global user.name "Tom"
View server.py
# socket server for hololens
import socket
host = "127.0.0.1"
port = 20620
timeout = 5
blocksize = 1024
anchor_db = {}
def main():
View tcp_sever.py
#!/usr/bin/env python
"""
A simple echo server
"""
import socket
host = ''
port = 20602
View collector.py
import twitter
import re
import html
import sys
from secrets import keys
from twitter.error import TwitterError
regex = re.compile(r"(#[A-Za-z]*)|(http(s|):\/\/[A-Za-z./0-9]*)|(@[A-Za-z]*)")