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 h=bubbleplot(varargin) | |
%BUBBLEPLOT Bubble plot, using MATLAB's scatter | |
% | |
% x, y -- data | |
% | |
x=varargin{1}(:); | |
y=varargin{2}(:); | |
data=sortrows([x 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
#!/usr/bin/python | |
import sys | |
from optparse import OptionParser | |
usage="Usage: %prog -f <filename> -p <positives> -l <length>" | |
parser = OptionParser(usage) | |
parser.add_option("-f", "--file", dest="filename", help="write report to FILE") | |
parser.add_option("-p", "--positives", type="float", dest="pos", help="% positives") | |
parser.add_option("-l", "--length", type="float", dest="len", help="% length") | |
import re |
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
#!/bin/bash | |
if [[ $# -eq 0 ]] | |
then | |
echo "Usage: `basename $0` <output file> <input files>" | |
exit 1 | |
fi | |
ofile=$1 | |
if [[ -f $ofile ]] | |
then |
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
#Courtesy: http://www.linuxjournal.com/content/tech-tip-extract-pages-pdf | |
#Add this to your .bashrc | |
function pdfpextr() | |
{ | |
# this function uses 3 arguments: | |
# $1 is the first page of the range to extract | |
# $2 is the last page of the range to extract | |
# $3 is the input file | |
# output file will be named "inputfile_pXX-pYY.pdf" |
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
<snippet> | |
<content><![CDATA[ | |
\begin{block}{${1:title}} | |
\begin{itemize} | |
\item ${2:items}. | |
\end{itemize} | |
\end{block} | |
]]></content> | |
<!-- Optional: Set a tabTrigger to define how to trigger the snippet --> | |
<tabTrigger>block</tabTrigger> |
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
<snippet> | |
<content><![CDATA[ | |
\begin{columns} | |
\begin{column}{${1:2.5in}} | |
$3 | |
\end{column} | |
\begin{column}{${2:2.5in}} | |
\end{column} | |
\end{columns} |
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
% From http://tex.stackexchange.com/questions/52715/modifying-labels-on-some-enumerated-items | |
\def\asteriskitem{*} | |
\makeatletter | |
\def\sitem{% | |
\expandafter\let\expandafter\originallabel\csname labelenum\romannumeral\@enumdepth\endcsname | |
\expandafter\def\csname labelenum\romannumeral\@enumdepth\expandafter\endcsname\expandafter{% | |
\expandafter\asteriskitem\originallabel}% | |
\item | |
\expandafter\let\csname labelenum\romannumeral\@enumdepth\endcsname\originallabel | |
} |
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
<snippet> | |
<content><![CDATA[\\begin{frame}[fragile]{${1:title}} | |
$2 | |
\\end{frame}]]></content> | |
<tabTrigger>fframe</tabTrigger> | |
<scope>text.tex.latex</scope> | |
<description>Beamer frame</description> | |
</snippet> |
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
<snippet> | |
<content><![CDATA[ | |
\begin{python} | |
${1} | |
\end{python} | |
]]></content> | |
<!-- Optional: Set a tabTrigger to define how to trigger the snippet --> | |
<tabTrigger>py</tabTrigger> | |
<!-- Optional: Set a scope to limit where the snippet will trigger --> | |
<scope>text.tex.latex</scope> |
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 networkx as nx | |
import matplotlib.pyplot as plt | |
from math import log | |
def hypercube_graph(n): | |
"""Create a hypercube graph of size n | |
(int) -> Graph | |
""" | |
H = nx.Graph() | |
for i in range(2**n): | |
for j in range(n): |
OlderNewer