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> | |
#include <unordered_set> | |
typedef std::unordered_set< int > IntUSet; | |
int main() | |
{ | |
IntUSet iset; | |
// Insert |
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> | |
#include <unordered_set> | |
struct Point | |
{ | |
int x, y; | |
bool operator == ( const Point& p ) const | |
{ | |
return ( ( x == p.x ) && ( y == p.y ) ); |
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
% At the beginning of the document | |
\usepackage{graphicx} | |
% At the place you want a figure | |
\begin{figure}[h] | |
\centering | |
\includegraphics[scale=0.3]{pics/foobar.png} | |
\caption{This is a caption for the figure.} | |
\label{foobar-figure} | |
\end{figure} |
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
% Add the packages | |
\usepackage{algorithm} | |
\usepackage{algpseudocode} | |
% Insert the algorithm | |
\begin{algorithm} | |
\caption{Compute sum of integers in array} | |
\label{array-sum} | |
\begin{algorithmic}[1] | |
\Procedure{ArraySum}{$A$} |
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
% Package for subfloat | |
\usepackage{subfig} | |
% Figure with two sub-figures | |
\begin{figure} | |
\centering | |
\subfloat[] | |
{ | |
\includegraphics[scale=.5]{fig-1.pdf} | |
\label{fig:foo-1} |
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} | |
\centering | |
\subfloat[] | |
{ | |
\includegraphics[scale=.6]{fig-1.pdf} | |
\label{fig:foo-1} | |
} | |
\par | |
\subfloat[] | |
{ |
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
# Delete page 170 from foo.djvu | |
djvm -d foo.djvu 170 | |
# Delete pages 170-174 from foo.djvu | |
for ( $i = 0; $i -lt 5; $i++ ) { djvm -d foo.djvu 170 } |
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
# Append back.djvu to front.djvu | |
djvm -i front.djvu back.djvu |
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
%-----------------------------------------------------------------------------% | |
% Letter class | |
\documentclass[a4paper, 10pt]{letter} | |
% Name of sender | |
\name{Joe Fox} | |
% Signature of sender | |
\signature{Joe Fox} |
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
augroup CursorLineOnlyInActiveWindow | |
autocmd! | |
autocmd VimEnter,WinEnter,BufWinEnter * setlocal cursorline | |
autocmd WinLeave * setlocal nocursorline | |
augroup END |