We made this pie from this recipe:
Monday, February 27, 2012
Fuel economy vs. speed
We all suspect that going faster decreases your fuel economy, and I did an experiment to verify this!
Thursday, February 9, 2012
Where to put new LaTeX packages
The mcode package, for instance, is in:
~/Library/texmf/tex/latex/mcode
Now why doesn't the Mac OS search function find this file?
~/Library/texmf/tex/latex/mcode
Now why doesn't the Mac OS search function find this file?
Wednesday, January 25, 2012
Making MATLAB figures prettier
Changing the default line style (e.g. for printing in black-and-white):
For dotted lines exported to .eps:
http://www.mathworks.com/matlabcentral/fileexchange/15743-fix-dashed-and-dotted-lines-in-eps-export
Usage:
print -depsc myfigure.eps
fix_dottedline('myfigure.eps')
More to come...
set(0,'DefaultAxesLineStyleOrder',{'-','--',':'})
set(0,'DefaultAxesColorOrder',[0 0 0])
For dotted lines exported to .eps:
http://www.mathworks.com/matlabcentral/fileexchange/15743-fix-dashed-and-dotted-lines-in-eps-export
Usage:
print -depsc myfigure.eps
fix_dottedline('myfigure.eps')
More to come...
Tuesday, January 17, 2012
Mathematica for MATLAB users
I plan on expanding this post later; for now it's just a place to put this very useful link:
http://meng6.net/pages/matlab_mathematica_equivalent_commands/
Clear all:
Defining a matrix: A = [1 2 ; 3 4]
A = {{1, 2}, {3, 4}}
This gives you something horrendous:
http://meng6.net/pages/matlab_mathematica_equivalent_commands/
Clear all:
ClearAll["Global`*"]
Defining a matrix: A = [1 2 ; 3 4]
A = {{1, 2}, {3, 4}}
This gives you something horrendous:
Integrate[ 1/(x + 1)^2 , {x , y, 1}
But this gives you the nice expression that you probably wanted:
Simplify[Integrate[ 1/(x + 1)^2 , {x , y, 1} ], {y > 0 , y < 1}]
Wednesday, January 11, 2012
Regex in TextPad
Just spent far too much time trying to figure out regular expressions in TextPad. Here's a good reference:
http://johnbokma.com/textpad/textpad-reference.pdf
The specific things that were holding me up:
http://johnbokma.com/textpad/textpad-reference.pdf
The specific things that were holding me up:
- Go to Preferences->Editor and check "Use POSIX regular expression syntax" so you don't have to escape your parentheses etc.
- Enclose tagged expressions (the things that you'll refer to in your replace string with \1, \2, etc) in parentheses
Latex - more commands
I've been doing 3 problem sets/week in LaTeX for the last several weeks; here are some more tips to follow up on my previous post:
Making your own functions:
\newcommand{\norm}[1]{\left\Vert #1 \right\Vert}
\DeclareMathOperator*{\argmin}{arg\,min}
The * puts the subscript below the operator. To stack subscripts:
\min_{\substack{ X>0 \\ Z \\ W=W^* }}
Different vector formats
Underline, with the line crossing descenders (as in gjpqy):
\usepackage{soul}
\setuldepth{abcdef} % sets ul depth based on letters w/o descenders
\newcommand{\vecu}[1]{\text{\ul{$#1$}}\xspace}
Shortcuts that I've found useful:
\newcommand{\reals}{\ensuremath{\mathbb{R}}\xspace}
\def \ba#1\ea{\begin{align*}#1\end{align*}}
\newcommand{\ii}{^{-1}}
\newcommand{\intii}{\int_{-\infty}^{\infty}}
Matrix formatting
check out these posts from Stefan Kottwitz's excellent TeXblog
A cool trick to turn + - = into alignment marks (e.g. for systems of linear equations)
http://tex.stackexchange.com/questions/6965/multicol-layout-for-systems-of-linear-equations
Cool stuff with figures
http://en.wikibooks.org/wiki/LaTeX/Floats,_Figures_and_Captions
MATLAB code
Get the mcode package, which configures the listings package use with MATLAB. The demo is pretty self-explanatory, and the package works great!
Miscellaneous:
Accent marks:
http://en.wikibooks.org/wiki/LaTeX/Accents
Found this while researching this post and learned a bunch of new things:
http://www.math.uiuc.edu/~hildebr/tex/basics.html
For example, use \eqref to put parentheses around the equation number.
To reduce vertical spacing around section headings: \usepackage[compact]{titlesec}
Cursive lowercase l, as in l2: \ell
Making your own functions:
\newcommand{\norm}[1]{\left\Vert #1 \right\Vert}
\DeclareMathOperator*{\argmin}{arg\,min}
The * puts the subscript below the operator. To stack subscripts:
\min_{\substack{ X>0 \\ Z \\ W=W^* }}
Different vector formats
Underline, with the line crossing descenders (as in gjpqy):
\usepackage{soul}
\setuldepth{abcdef} % sets ul depth based on letters w/o descenders
\newcommand{\vecu}[1]{\text{\ul{$#1$}}\xspace}
Bold:
\newcommand{\vecb}[1]{\ensuremath{\boldsymbol{#1}}\xspace}
And one more layer of shortcut/indirection (overwrites the caron diacritic)
\renewcommand{\v}[1]{\vect{#1}}
Shortcuts that I've found useful:
\newcommand{\reals}{\ensuremath{\mathbb{R}}\xspace}
\def \ba#1\ea{\begin{align*}#1\end{align*}}
\newcommand{\ii}{^{-1}}
\newcommand{\intii}{\int_{-\infty}^{\infty}}
Matrix formatting
check out these posts from Stefan Kottwitz's excellent TeXblog
A cool trick to turn + - = into alignment marks (e.g. for systems of linear equations)
http://tex.stackexchange.com/questions/6965/multicol-layout-for-systems-of-linear-equations
Cool stuff with figures
http://en.wikibooks.org/wiki/LaTeX/Floats,_Figures_and_Captions
MATLAB code
Get the mcode package, which configures the listings package use with MATLAB. The demo is pretty self-explanatory, and the package works great!
Miscellaneous:
Accent marks:
http://en.wikibooks.org/wiki/LaTeX/Accents
Found this while researching this post and learned a bunch of new things:
http://www.math.uiuc.edu/~hildebr/tex/basics.html
For example, use \eqref to put parentheses around the equation number.
To reduce vertical spacing around section headings: \usepackage[compact]{titlesec}
Cursive lowercase l, as in l2: \ell
Sunday, December 18, 2011
BaK4 vs BK7 prisms
I was shopping for binoculars recently, and in the process of researching what to buy I saw a big fuss about BaK4 (barium crown glass) prisms. The Internet made many vague claims of "sharper" and "expensive therefore better" in comparing BaK4 to BK7 (borosilicate crown glass), but what is really happening?
Thursday, December 15, 2011
Joshua Tree
Yesterday we rented some equipment (tent, sleeping bags, mats, cookstove) from the Caltech Y, packed everything into the car and drove out to Joshua Tree.
Labels:
birds,
California,
Joshua Tree,
stargazing,
travel
Subscribe to:
Posts (Atom)

