This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class brushTool(Tool): | |
"""Draws continuous circles at a given size""" | |
def canvasDown(self): | |
global toolLoc | |
toolLoc = cm() | |
def canvasHold(self): | |
if key.get_pressed()[K_LCTRL] or key.get_pressed()[K_RCTRL]: | |
color = tuple(map(cc, hls(hue/255, 0.5, 1))) | |
else: | |
color = currentColour |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def cmyk(color): | |
cmyk_scale = 100 | |
r = color[0] | |
g = color[1] | |
b = color[2] | |
if (r == 0) and (g == 0) and (b == 0): | |
# black | |
return 0, 0, 0, cmyk_scale |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <cstring> | |
using namespace std; | |
int main() { | |
int distance; | |
cin >> distance; | |
int strokes[5300]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
a = [5,1,4,2,3] | |
b = [2,5,3,1,4] | |
num_shifts = 0 | |
def f(i): | |
global a | |
if a[i] != b[i]: | |
cow = a[b.index(a[i])] | |
a[b.index(a[i])] = a[i] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jarcompile() { | |
jar cvfe $1.jar $1 *.class resources/* | |
echo -e "cd \$(dirname \$BASH_SOURCE)\njava -jar $1.jar\n" > $1.command | |
echo -e "java -jar $1.jar\n" > $1.bat | |
chmod +x $1.command | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
j() { | |
clear | |
echo "Compiling..." | |
javac $1.java | |
echo "Compiling complete! Running..." | |
java $1 | |
echo "Running complete!" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### Keybase proof | |
I hereby claim: | |
* I am csgregorian on github. | |
* I am csg (https://keybase.io/csg) on keybase. | |
* I have a public key whose fingerprint is 5389 E696 FE01 731C 60AF 9669 C5A3 21A9 E252 61B2 | |
To claim this, I am signing this object: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def sieve(n): | |
primes = [] | |
sieve = [True] * (n + 1) | |
for p in range(2, n+1): | |
if sieve[p]: | |
primes.append(p) | |
for i in range(p ** 2, n + 1, p): | |
sieve[i] = False |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function makeID(length) { | |
var text = ''; | |
var possible = 'abcdefghijklmnopqrstuvwxyz0123456789'; | |
for (var i = 0; i < length; i++) { | |
text += possible.charAt(Math.floor(Math.random() * possible.length)); | |
} | |
return text; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// LinkedListTest.java | |
import java.util.*; | |
public class LinkedListTest { | |
public static void main(String[] args) { | |
LinkedList list = new LinkedList<Integer>(3); | |
list.print(); | |
list.enqueue(4); | |
list.print(); |
OlderNewer