Skip to content

Instantly share code, notes, and snippets.

View oliverguhr's full-sized avatar
🤖
happy hacking

Oliver Guhr oliverguhr

🤖
happy hacking
View GitHub Profile
@oliverguhr
oliverguhr / baseline_hatespeech.py
Last active August 2, 2019 12:51
Simple hatespeech classifyer using Pyhton and fastText
import fasttext
def load_data(path):
file = open(path, "r",encoding="utf-8")
data = file.readlines()
return [line.split("\t") for line in data]
def save_data(path,data):
with open(path, 'w',encoding="utf-8") as f:
f.write("\n".join(data))
public List<List<String>> BalancedLatinSquares(int n)
{
var result = new List<List<String>>() { };
for (int i = 0; i < n; i++)
{
var row = new List<String>();
for (int j = 0; j < n; j++)
{
var cell = ((j % 2 == 1 ? j / 2 + 1 : n - j / 2) + i) % n;
cell++; // start counting from 1