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
%% Your packages | |
\usepackage{array} %for vertical thick lines in tables | |
\usepackage{multirow} %multirow tables | |
\usepackage{nicefrac} %for fractions like 1/4 | |
%Package list ends here | |
% Macro for 'List of Symbols', 'List of Notations' etc... | |
\def\listofsymbols{\input{symbols} \clearpage} | |
\def\addsymbol #1: #2#3{$#1$ \> \parbox{5in}{#2 \dotfill \pageref{#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
[Desktop Entry] | |
Name=Dispay Name of App | |
GenericName=Basic Name of App | |
Comment=Comment | |
Keywords=keywords;separated;with;semi-colons | |
Exec=/path/to/file/to/run with parameters | |
Terminal=true|false | |
Type=Application | |
StartupNotify=true | |
Icon=/path/to/icon.png |
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 <map> | |
#include <vector> | |
/** | |
* Provides a basic interpolation mechanism in C++ using the STL. | |
* Maybe not the fastest or most elegant method, but it works (for | |
* linear interpolation!!), and is fast enough for a great deal of | |
* purposes. It's also super easy to use, so that's a bonus. | |
*/ | |
class LinearInterpolator { |
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
private boolean isLong(String str) { | |
try { | |
Long.parseLong(str); | |
} | |
catch(NumberFormatException e) { | |
return false; | |
} | |
return true; | |
} |
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
\usepackage{xfrac} | |
... | |
\begin{itemize} | |
\item 1$\sfrac{1}{4}$ cups of sugar | |
\item $\sfrac{1}{2}$ cup of butter | |
\end{itemize} |
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
\usepackage{multirow} | |
... | |
\begin{table}[H] | |
\begin{center} | |
\caption{Example} | |
\label{tab:example} | |
\begin{tabular}{lcc} | |
Column A & \multicolumn{2}{c}{Columns B and C} \\ |
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
class Derp { | |
// hold the rank of each derp here | |
int rank; | |
} | |
// now, we must make a comparator class which knows how to sort our Derp class: | |
class DerpComp implements Comparator<Derp> { | |
public int compare(Derp a, Derp b) { | |
// return -1 if a < b | |
if(a.rank < b.rank) |
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
#!/usr/bin/env python | |
import urllib2 | |
# get the html of a url | |
def GetHTML(url): | |
# open it up | |
f = urllib2.urlopen(url) | |
str = f.read() | |
return str | |
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
#!/usr/bin/env python | |
import psutil | |
while True: | |
print psutil.cpu_percent(interval=1, percpu=True) |
NewerOlder