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
% http://tug.org/pracjourn/2006-4/madsen/madsen.pdf | |
\begin{align*} | |
\dbx &= \dbx[3cm] \\ | |
&= \dbx | |
\end{align*} | |
\begin{equation} | |
\begin{split} |
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
perl -n -e '/(http:\/\/community.livejournal.com\/clinic_duty\/[0-9]+.html)/ && print "$1\n"' toc.html | wc -l |
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
perl -n -e '/(http:\/\/community.livejournal.com\/clinic_duty\/[0-9]+.html)/ && print "$1\n"' toc.html | wget |
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
% http://www.cs.uiuc.edu/~jeffe/pubs/latex.html | |
% ============================-*- LaTeX -*-============================= | |
% | |
% jeffe.sty -- macros I use everywhere | |
% | |
% Jeff Erickson (jeffe@cs.uiuc.edu) | |
% Last modified 22 May 2010 | |
% This is free; caveat emptor! | |
% | |
% Requirements that may not be part of every TeX distribution: |
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
function eliminateDuplicates(arr) { | |
var i, | |
len=arr.length, | |
out=[], | |
obj={}; | |
for (i=0;i<len;i++) { | |
obj[arr[i]]=0; | |
} | |
for (i in obj) { |
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
// top k denest regions: the k-th region is on the top | |
class RegionCmp { | |
public: | |
bool operator()(const Region& lhs, const Region& rhs) const { | |
return lhs.d > rhs.d; | |
} | |
}; | |
typedef priority_queue<Region, vector<Region>, RegionCmp> RegionPQ; |
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
# generate combinations | |
# | |
# http://docs.python.org/2/library/itertools.html#itertools.combinations | |
# | |
# combinations(iterable, r) --> combinations object | |
# Return successive r-length combinations of elements in the iterable. | |
combinations(range(4), 3) --> (0,1,2), (0,1,3), (0,2,3), (1,2,3) |
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
#change your Mac hostname with the command line and make it permanent: | |
sudo scutil –-set HostName new_hostname |
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
clock_t start, end; | |
start = clock(); | |
// | |
// YOUR CODE | |
// | |
end = clock(); | |
cerr << "Inverted Index is built in " |
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
#include <iostream> | |
using namespace std; | |
class Base{ | |
public: | |
virtual ~Base() { | |
cout << "Base Destruct" << endl; | |
} | |
virtual void print(){ | |
cout << "Base" << endl; |