Skip to content

Instantly share code, notes, and snippets.

View SigmaX's full-sized avatar

Eric 'Siggy' Scott SigmaX

View GitHub Profile
#!/bin/python3
import os
def bomberMan(n, grid):
# TODO Write your code here
if __name__ == '__main__':
fptr = open(os.environ['OUTPUT_PATH'], 'w')
def miniMaxSum(arr):
# TODO Fill this in
if __name__ == '__main__':
arr = list(map(int, input().rstrip().split()))
miniMaxSum(arr)
#!/bin/bash
export B2_ACCOUNT_ID=<your keyID here>
export B2_ACCOUNT_KEY=<your key here>
export RESTIC_PASSWORD=<your restic repository password here>
command1="restic -r b2:mybucket-desktop-backups:alfred/ backup /home/eric/Documents/ 2>&1"
output1=$(eval "${command1}")
result1=$?
@SigmaX
SigmaX / NEATStatistics.java
Created January 23, 2018 16:59
Collects Statistics on NEATIndividuals.
package ec.neat;
import ec.EvolutionState;
import ec.Statistics;
import ec.neat.NEATGene;
@SigmaX
SigmaX / SimplePerseus.py
Created December 13, 2017 15:54
Simple Perseus Parsing
import xmltodict
def perseus_xml_to_text(path):
'''Manually load a work, because I don't know how to do it with CLTK (see https://github.com/cltk/cltk/issues/615).'''
with open(path) as f:
doc = xmltodict.parse(f.read())
paragraphs = doc['TEI.2']['text']['body']['div1']['div2']
return [perseus_get_paragraph(p['p']) for p in paragraphs]
def perseus_get_paragraph(p_root):
@SigmaX
SigmaX / MyXMLCorpusReadr.py
Created December 13, 2017 15:52
Modified XMLCorpusReader
from __future__ import print_function, unicode_literals
import codecs
# Use the c version of ElementTree, which is faster, if possible:
try: from xml.etree import cElementTree as ElementTree
except ImportError: from xml.etree import ElementTree
from six import string_types