The overall code are shown as follows.
Here is a zip file containing all patches.
#!/bin/sh | |
# this script does absolutely ZERO error checking. however, it worked | |
# for me on a RHEL 6.3 machine on 2012-08-08. clearly, the version numbers | |
# and/or URLs should be made variables. cheers, zmil...@cs.wisc.edu | |
mkdir mosh | |
cd mosh |
from fabric.api import * | |
class Tmux(object): | |
"""Tmux helper for fabric""" | |
def __init__(self, session_name, run_cmd=run): | |
self.session_name = session_name | |
self.run_cmd = run_cmd | |
self.create_session() |
# http://stackoverflow.com/questions/613183/python-sort-a-dictionary-by-value | |
# http://wiki.python.org/moin/HowTo/Sorting/ | |
import operator | |
x = {1: 2, 3: 4, 4:3, 2:1, 0:0} | |
sorted_x = sorted(x.iteritems(), key=operator.itemgetter(1),reverse=True) | |
y = [ ('john', 'A', 15), ('jane', 'B', 12), ('dave', 'B', 10),] |
The overall code are shown as follows.
Here is a zip file containing all patches.
NS = {'tei': 'http://www.tei-c.org/ns/1.0'} | |
def tei_to_fulltext(tei): | |
from lxml import etree | |
from six import text_type | |
parser = etree.XMLParser(encoding='UTF-8', recover=True) | |
tei = tei if not isinstance(tei, text_type) else tei.encode('utf-8') | |
root = etree.fromstring(tei, parser) | |
return get_fulltext(root) |
#!/usr/bin/env bash | |
# Licensed to the Apache Software Foundation (ASF) under one or more | |
# contributor license agreements. See the NOTICE file distributed with | |
# this work for additional information regarding copyright ownership. | |
# The ASF licenses this file to You under the Apache License, Version 2.0 | |
# (the "License"); you may not use this file except in compliance with | |
# the License. You may obtain a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 |
import shlex, subprocess | |
raw_args = "sqlcmd -S cypress.csil.sfu.ca -d cmpt354_bank -i %s.sql"%(test) | |
args = shlex.split(raw_args) | |
output = subprocess.check_output(args) | |
print output |
DECLARE @Query1Checksum bigint | |
DECLARE @Query2Checksum bigint | |
Use Northwind354 | |
-- Get checksum from source query | |
Select @Query1Checksum = CHECKSUM_AGG(BINARY_CHECKSUM(*)) | |
FROM | |
( | |
-- [Start Source Query] | |
SELECT O.OrderID, O.OrderDate, |
#include <iostream> | |
using namespace std; | |
class Base{ | |
public: | |
virtual ~Base() { | |
cout << "Base Destruct" << endl; | |
} | |
virtual void print(){ | |
cout << "Base" << endl; |
clock_t start, end; | |
start = clock(); | |
// | |
// YOUR CODE | |
// | |
end = clock(); | |
cerr << "Inverted Index is built in " |