This file contains hidden or 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 csv | |
tsvFileName = "tsv.txt" | |
csvFileName = tsvFileName + ".csv" | |
tsvFile = csv.reader(file(tsvFileName, "r"), delimiter = "\t") | |
csvFile = csv.writer(file(csvFileName, "w"), lineterminator="\n") | |
for row in tsvFile: | |
csvFile.writerow(row) |
This file contains hidden or 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
#include <fstream> | |
#include <vector> | |
#include <string> | |
#include <iostream> | |
template<typename T>inline std::vector< std::vector<T> > | |
tsv2Vrector(const std::string &filename, const int &num_column) | |
{ | |
std::vector< std::vector<T> > table; | |
ifstream ifs; |
This file contains hidden or 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 sys | |
import codecs | |
sys.stdin = codecs.getreader("utf-8")(sys.stdin) | |
sys.stdout = codecs.getwriter("utf-8")(sys.stdout) | |
lines = sys.stdin.read().splitlines() | |
table = [] | |
for line in lines: | |
table.append(line.split("\t")) |
This file contains hidden or 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 sys | |
def transposition(infile, outfile): | |
with open(infile, "r") as fi: | |
table = [] | |
for line in fi: | |
table.append(line.rstrip().split("\t")) | |
table = map(list, zip(*table)) |
This file contains hidden or 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
#include <map> | |
#include <string> | |
#include <algorithm> | |
#include <iostream> | |
template<typename A, typename B> | |
std::pair<B,A> flip_pair(const std::pair<A,B> &p) | |
{ | |
return std::pair<B,A>(p.second, p.first); | |
} |
This file contains hidden or 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 commands | |
import sendGmail | |
from datetime import datetime | |
from datetime import timedelta | |
arg = "" | |
while len(arg) == 0: | |
arg = raw_input("input substring of process name: ") | |
This file contains hidden or 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
# coding: utf-8 | |
import smtplib | |
from email.mime.text import MIMEText | |
from email.header import Header | |
from email.utils import formatdate | |
def create_message(from_addr, to_addrs, subject, body): | |
msg = MIMEText(body) | |
msg["Subject"] = subject |
This file contains hidden or 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
#include <iostream> | |
#include <queue> | |
#include <vector> | |
using namespace std; | |
struct Larger { | |
bool operator() (int a, int b) { | |
return a < b; | |
} | |
}; |
This file contains hidden or 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 sys | |
import codecs | |
from sets import Set | |
import xml.etree.ElementTree as ET | |
convert_tuples = [ | |
(u'\u00a6',u'\u007c'),#broken bar=>vertical bar | |
(u'\u2014',u'\u2015'),#horizontal bar=>em dash | |
(u'\u2225',u'\u2016'),#parallel to=>double vertical line | |
(u'\uff0d',u'\u2212'),#minus sign=>fullwidth hyphen minus |
This file contains hidden or 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 sys | |
import codecs | |
from sets import Set | |
import xml.etree.ElementTree as ET | |
convert_tuples = [ | |
(u'\u00a6',u'\u007c'),#broken bar=>vertical bar | |
(u'\u2014',u'\u2015'),#horizontal bar=>em dash | |
(u'\u2225',u'\u2016'),#parallel to=>double vertical line | |
(u'\uff0d',u'\u2212'),#minus sign=>fullwidth hyphen minus |
OlderNewer