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 python | |
# encoding: utf-8 | |
""" | |
MONitor & EXecute | |
Yong-Yeol Ahn (http://yongyeol.com/) | |
This script monitors multiple files and executes the given command when | |
any of those files is changed. | |
""" |
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
TEX = pdflatex -interaction nonstopmode | |
BIB = bibtex | |
GS = gs -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite | |
COVER = cover | |
PAPER = paper_main | |
SUPP = paper_supp | |
BIBFILE = temp.bib | |
BUNDLE = paper_bundle.pdf |
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 python | |
import sys | |
import json | |
import httplib | |
class FuncAssociate(object): | |
"""Query funcassociate to find out enriched GO terms.""" | |
host = 'llama.mshri.on.ca' | |
query_url = '/cgi/funcassociate/serv' |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
def logodds(corpora_dic, bg_counter): | |
""" It calculates the log odds ratio of term i's frequency between | |
a target corpus and another corpus, with the prior information from | |
a background corpus. Inputs are: | |
- a dictionary of Counter objects (corpora of our interest) | |
- a Counter objects (background corpus) | |
Output is a dictionary of dictionaries. Each dictionary contains the log | |
odds ratio of each word. |
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
while true; do lynx --dump "https://shop.lego.com/en-US/LEGO-NASA-Apollo-Saturn-V-21309" | grep "Available now" && osascript -e 'display notification "Lego set available!" with title "Lego alert!!"'; sleep 60; done |
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 python3 | |
import re | |
import sys | |
if __name__ == "__main__": | |
template_path = sys.argv[1] | |
content = open(template_path).read() | |
var_pattern = re.compile('{.+?}') | |
variables = set(re.findall(var_pattern, content)) |
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 python | |
"""Print the dates of certain day of week given date range.""" | |
import argparse | |
from datetime import date | |
import pandas as pd | |
def parse_dayofweek(dow): | |
"""Return pandas frequency string from day of the week name.""" |
OlderNewer