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
#!/usr/bin/env bash | |
# Rename files in a Windows folder that somehow ended up with illegal Windows filenames | |
# (because NTFS doesn't enforce this, but it makes the files unusable and indestructible). | |
# Must be run in Linux. There seems to be no other way. | |
ls -1 | awk '/[/\:*?"<>|]/ { | |
orig = $0; | |
gsub(/[/\:*?"<>|]/, "_", $0); | |
gsub(/'"'"'/, "'"'"'\"'"'"'\"'"'"'", orig); | |
gsub(/'"'"'/, "'"'"'\"'"'"'\"'"'"'", $0); | |
print "mv '"'"'" orig "'"'"' '"'"'" $0 "'"'"'" |
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
from __future__ import print_function | |
import random | |
STRATEGY = {} | |
def expected_value(seen, choice): | |
''' | |
The expected amount you get swindled, given what you've seen so | |
far (`seen`, adjusted so that the lowest value is 0) and the |
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
'''Build an executable.''' | |
from distutils.core import setup | |
import os | |
import py2exe | |
setup(console=[ | |
{'script': 'main.py'} | |
], | |
options={'py2exe': { |
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
#!/usr/bin/env bash | |
# Reformat as [-]token[-]|||POS_TAGS | |
cat $1 | awk ' | |
BEGIN { | |
FS = "·"; | |
ORS = " "; | |
buckwalter = "java edu.stanford.nlp.international.arabic.Buckwalter"; | |
} | |
/^t/ { |