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
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 |
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
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)) |