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
"""BFS.py | |
Breadth First Search. See also LexBFS.py. | |
D. Eppstein, May 2007. | |
""" | |
try: | |
set | |
except NameError: |
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 <unistd.h> | |
// Check whether file exist | |
// http://stackoverflow.com/questions/230062/whats-the-best-way-to-check-if-a-file-exists-in-c-cross-platform | |
if( access( fname, F_OK ) != -1 ) { | |
// file exists | |
} else { | |
// file doesn't exist | |
} |
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
import subprocess | |
def call_command(command): | |
process = subprocess.Popen(command.split(' '), | |
stdout=subprocess.PIPE, | |
stderr=subprocess.PIPE) | |
return process.communicate() | |
# An example | |
if __name__ == "__main__": | |
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 is_number(s): | |
try: | |
float(s) | |
return True | |
except ValueError: | |
return False |
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
// see http://www.johndcook.com/IEEE_exceptions_in_cpp.html for details | |
bool IsNumber(double x) | |
{ | |
// This looks like it should always be true, | |
// but it's false if x is a NaN. | |
return (x == x); | |
} | |
#include <float.h> |
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
\begin{figure}[htbp] | |
\begin{minipage}[b]{0.5\linewidth} | |
\label{SzvsT} | |
\centering | |
\includegraphics[width=\textwidth]{fig/SzvsT.pdf} | |
\caption{initial node set size $|V_Q|$ versus runing time} | |
\end{minipage} | |
\vspace{0.5cm} | |
\begin{minipage}[b]{0.5\linewidth} | |
\label{RvsTime} |
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
\marginparwidth 0pt | |
\oddsidemargin 0pt | |
\evensidemargin 0pt | |
\marginparsep 0pt | |
\parindent 0pt | |
\parskip 5pt | |
\topmargin 0pt |
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
draft: | |
pandoc -N --latex-engine=xelatex --template=template.tex def.markdown -o def.pdf --biblio def.bib | |
final: | |
pandoc -N --latex-engine=xelatex --template=template.tex def.markdown -o def.tex --biblio def.bib | |
bibtex def | |
xelatex def.tex | |
xelatex def.tex |
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
\usetheme{default} | |
\usepackage{mathpazo} | |
\usepackage{fontspec} | |
\setbeamertemplate{background canvas}{\includegraphics [width=\paperwidth]{blackboard_bk.pdf}} | |
\newfontfamily\chalkd{Chalkduster.ttf} | |
\newfontfamily\chalkb{Chalkboard.ttc} | |
\setbeamerfont*{normal text}{family = \chalkd} | |
\setbeamerfont{alerted text}{family = \chalkd} | |
\setbeamerfont{structure}{family = \chalkd} |
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
\begin{figure} | |
% Manual: http://bit.ly/N5qECH | |
\begin{algorithm}[H] | |
\caption{$\textsc{AlgName}$} | |
\label{alg:foobar} | |
\SetAlFnt{\tiny \sf} | |
\SetCommentSty{textrm} | |
\SetKwComment{Comment}{~$\triangleright$~}{} |