I hereby claim:
- I am kkiningh on github.
- I am kkiningh (https://keybase.io/kkiningh) on keybase.
- I have a public key whose fingerprint is EED1 A692 2FEE 243A F394 4722 5E4B 5313 57D6 4298
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
""" | |
* Copyright (c) 2012-2016, Nic McDonald | |
* All rights reserved. | |
* | |
* Redistribution and use in source and binary forms, with or without | |
* modification, are permitted provided that the following conditions are met: | |
* | |
* - Redistributions of source code must retain the above copyright notice, this | |
* list of conditions and the following disclaimer. | |
* |
Mostly from http://users.ece.utexas.edu/~dpan/ee382v_opt_syllabus.pdf
import numpy as np | |
import scipy.stats | |
import scipy.signal | |
sbox = np.array([ | |
0x63,0x7c,0x77,0x7b,0xf2,0x6b,0x6f,0xc5,0x30,0x01,0x67,0x2b,0xfe,0xd7,0xab,0x76, | |
0xca,0x82,0xc9,0x7d,0xfa,0x59,0x47,0xf0,0xad,0xd4,0xa2,0xaf,0x9c,0xa4,0x72,0xc0, | |
0xb7,0xfd,0x93,0x26,0x36,0x3f,0xf7,0xcc,0x34,0xa5,0xe5,0xf1,0x71,0xd8,0x31,0x15, | |
0x04,0xc7,0x23,0xc3,0x18,0x96,0x05,0x9a,0x07,0x12,0x80,0xe2,0xeb,0x27,0xb2,0x75, | |
0x09,0x83,0x2c,0x1a,0x1b,0x6e,0x5a,0xa0,0x52,0x3b,0xd6,0xb3,0x29,0xe3,0x2f,0x84, |
#include <cstdint> | |
#include <cstddef> | |
#include <type_traits> | |
namespace detail { | |
/* Bit of metaprogramming to select a template based on the size of the | |
* smallest integer that can represent a integer template parameter */ | |
namespace traits { | |
template <typename T> | |
constexpr size_t bitsize(T); |
import java.util.ArrayList; | |
import java.util.Random; | |
import java.util.Scanner; | |
public class Game { | |
Random random = new Random(); | |
int playerHealth = 10; | |
public void playTurn(Scanner reader) { | |
playMovement(reader); |
# Plotting Code | |
import numpy as np | |
import matplotlib.pyplot as plt | |
import matplotlib.colors | |
import scipy.io | |
plt.style.use('bmh') | |
k = 50 # image size is k x k | |
m = k * k # total number of pixels |
import matplotlib.pyplot as plt | |
import numpy as np | |
from matplotlib.animation import FuncAnimation | |
from matplotlib.patches import Circle | |
n = 2; N = 3; T = 30; D = 0.4 | |
p1start = np.array([-1.0, 0.0]).reshape([2,1]) | |
p1final = np.array([ 1.0, 0.0]).reshape([2,1]) |
def draw_circle_packing(x, D, cmap=plt.cm.Spectral): | |
T, N, _ = x.shape | |
R = D/2 | |
# Create axis | |
fig, ax = plt.subplots(figsize=(5,5)) | |
ax.set(xlim=(-R, 1+R), ylim=(-R, 1+R)) | |
# Create new circle objects | |
colors = cmap(np.linspace(0, 1, N)) |