(a + b) % n = ((a % n) + (b % n)) % n
(a * b) % n = ((a % n) * (b % n)) % n
color a = color(255, 152, 145); | |
color b = color(52, 81, 255); | |
void setup(){ | |
size(500,500); | |
} | |
void draw(){ | |
fill(a); | |
noStroke(); |
# loads the CSV corpus file from the links here (http://help.sentiment140.com/for-students) and outputs just the tweet text | |
lines = [] | |
with open("testdata.manual.2009.06.14.clean.txt", "w") as outfile: | |
with open("testdata.manual.2009.06.14.csv", 'r') as infile: | |
lines = infile.readlines() | |
for line in lines: | |
bits = line.split(",") | |
text = ",".join(bits[5:]).replace("&", "&").replace("<", "<").replace(">", ">") | |
text = text[1:-2] |
// to use these functions, place this file in ./permute/permute.go and import "./permute" | |
// uses the "recursive algorithm" method from here: http://www.cut-the-knot.org/do_you_know/AllPerm.shtml | |
package permute | |
var level int | |
var value []int | |
var N int | |
var num int | |
var intPerms [][]int | |
var bytePerms [][]byte |
/* | |
* Go implementation of Euler's product formula to find for the totient function (aka. phi function) | |
* https://en.wikipedia.org/wiki/Euler's_totient_function#Euler.27s_product_formula | |
*/ | |
package main | |
import ( | |
"fmt" | |
) |
I hereby claim:
To claim this, I am signing this object:
#!/usr/bin/python3 | |
# adapted from code at https://github.com/iandioch/ceres/ | |
import json | |
from urllib.request import urlopen, Request | |
from bs4 import BeautifulSoup | |
cpssds = set([ | |
'Noah Ó Donnaile', |
#!/usr/bin/python3 | |
# adapted from code at https://github.com/iandioch/ceres/ | |
import json | |
from urllib.request import urlopen, Request | |
from bs4 import BeautifulSoup | |
def is_dcu(c): | |
return c == 'Dublin City University' |
PImage dog; | |
final int NUM_DOGS = 5; | |
int iter = 0; | |
final int MAX_ITER = 64; | |
void setup(){ | |
size(600, 600); | |
dog = loadImage("dog-mature-landing-hero.jpg"); | |
} |
int iter = 0; | |
final int MAX_ITER = 120; | |
final String PHRASE = "Repeal"; | |
final int TEXT_SIZE = 96; | |
void setup() { | |
size(600, 600); | |
frameRate(60); | |
background(0); | |
noStroke(); |