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
/* | |
* 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" | |
) |
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
// 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 |
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
# 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] |
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
color a = color(255, 152, 145); | |
color b = color(52, 81, 255); | |
void setup(){ | |
size(500,500); | |
} | |
void draw(){ | |
fill(a); | |
noStroke(); |
NewerOlder