% for smallper page
\usepackage[papersize={4.2in, 1.4in}, text={4in, 1.3in}]{geometry}
% for fancy math

% rank operator

% Matrix transpose

% for extra space at the end of abbreviation

% positive semi-definite

% boldface uppercase letters for matrices
\newcommand{\Abf}{\ensuremath{\mathbf A}}
\newcommand{\Bbf}{\ensuremath{\mathbf B}}

% boldface lowercase letters for vectors
\newcommand{\xbf}{\ensuremath{\mathbf x}}

% for math blackboard font
% set of real numbers
\newcommand{\Rbb}{\ensuremath{\mathbb R}}


For any real symmetric matrcies $\Abf$ such that $\rank(\Abf_{n\times n})=r$,
the following statements are equivalent
and any one of them can serve as the definition of
\emph{positive semi-definite} (\psd) matrices.
  \item $\trans\xbf \Abf\xbf \geq 0$ for any non-zero vector
    $\xbf\in\Rbb^{n\times 1}$.
  \item All the $n$ eigenvalues of $\Abf$ are non-negative.
  \item $\Abf=\trans\Bbf \Bbf$ for some $\Bbf$ with $\rank(\Bbf)=r$.

Comments Off



  \begin{theorem}[Fermat's Last Theorem]
    $x^n + y^n = z^n$.
  As shown in Theorem \ref{thm:fermat}...

    Here goes an example!

    $e^{i\pi} + 1 = 0$


Comments Off


% for smallper page
\usepackage[papersize={2.6in, 1.2in}, text={2.6in, 1.2in}]{geometry}
% for fancy math

% Greek letter lowercase boldface

% Greek letter uppercase boldface


Comments Off



\usepackage[papersize={80mm, 80mm}, text={75mm, 70mm}]{geometry}

\newcommand{\attrib}[1]{\nopagebreak{\raggedleft\footnotesize #1\par}}

  {Hoefler Text}\fontsize{12pt}{12pt}\selectfont #1}%


\settowidth{\versewidth}{Ahi quanto a dir qual era \`e cosa dura}
Nel mezzo del cammin di nostra vita \\
mi ritrovai per una selva oscura, \\
ch\'e la diritta via era smarrita. \\

Ahi quanto a dir qual era \`e cosa dura \\
esta selva selvaggia e aspra e forte \\
che nel pensier rinova la paura! \\

Tant'\`e amara che poco \`e pi\`u morte; \\
ma per trattar del ben ch'i' vi trovai, \\
dir\`o de l'altre cose ch'i' v'ho scorte. \\
\attrib{\textit{Divina Commedia, Inferno, Canto I, 1-9}}
\attrib{Dante Alighieri}
Comments Off




    \tikzstyle{abox} = [rectangle, thick, text centered ,
    text width=3.5cm, minimum height=1cm,
    top color=white, bottom color=blue!30, draw=blue!40]
    \tikzstyle{xbox} = [rectangle, thick, text centered ,
    text width=.3cm, minimum height=3.5cm,
    top color=white, bottom color=red!30, draw=red!40]
    \tikzstyle{bbox} = [rectangle, thick, text centered ,
    text width=.3cm, minimum height=1cm,
    top color=white, bottom color=green!30, draw=green!40]
    \coordinate (A) at (0cm, 0cm);
    \coordinate (X) at (3cm, 0cm);
    \coordinate (E) at (4cm, 0cm);
    \coordinate (B) at (5.2cm, 0cm);

    % measurement
    \node [abox] (ABox) at (A) {$\mathbf{A}$};
    \node [left]  at (ABox.west)  {$\scriptstyle m$};
    \node [below] at (ABox.south) {$\scriptstyle n$};
    \node [yshift=-2.5cm] at (A) {measurement};

    % input
    \node [xbox] (XBox) at (X) {$\mathbf{x}$};
    \node [left]  at (XBox.west)  {$\scriptstyle n$};
    \node [below] at (XBox.south) {$\scriptstyle 1$};
    \node [yshift=-2.5cm] at (X) {input};

    % equal
    \node at (E) {=};

    % observation
    \node [bbox] (BBox) at (B) {$\mathbf{b}$};
    \node [left]  at (BBox.west)  {$\scriptstyle m$};
    \node [below] at (BBox.south) {$\scriptstyle 1$};
    \node [yshift=-2.5cm] at (B) {observation};
Comments Off



\usepackage[papersize={35mm, 45mm}, text={30mm, 40mm}]{geometry}


\AAbf_{\scriptscriptstyle m\times n} \medspace
\xxbf_{\scriptscriptstyle n\times 1} =
\bbbf_{\scriptscriptstyle m\times 1}

\AAbf_{m\times n} \medspace
\xxbf_{n\times 1} =
\bbbf_{m\times 1}

Comments Off

Sometimes, we want to see disk usage in a human readable form (KB, MB, GB) for each subdirectory.

[ytyoun@ladon: ~]# find . -maxdepth 1 -type d -exec du -sh {} \; | sort -h
4.0K	./nsmail
8.0K	./Downloads
8.0K	./.eggcups
8.0K	./.gnome2_private
8.0K	./.gvfs


120M	./.mozilla
186M	./emacs-24.2
223M	./.cache
240M	./Desktop
284M	./Work
444M	./.config
1.9G	.

How it works.

  1. find: a linux command to search for files or directories in a directory hierarchy.
  2. find .: runs the find command on the current directory
  3. find . -maxdepth 1 -type d: searches for all the directories contained in the current directory without descending to subdirectories below the current directory
  4. find (condition) -exec (command) {} \;: for each file or directory satisfied by the (condition), run (command).
    {} \; is replaced by each directory satisfied by the find command.
  5. du -sh (dir): displays the disk usage statistics of the directory (dir) in a human readable form.
    In this example, we just feed {} \; as we want to run du command for each directory obtained by the find command.
  6. | : linux pipe
  7. sort -h: sorts the human readable numbers such as KB, MB and GB.
Comments Off

1. Make sure you have Haskell module loaded.

[yuy121@cyberstar231: ~]# module list
Currently Loaded Modulefiles:
  1) realvnc/4.5r21561   6) matlab/R2012a      11) emacs/23.2
  2) java/1.6.0_45       7) mkl/    12) git/
  3) intel/11.1.073      8) netcdf/gcc/4.1.1   13) gcc/4.7.0
  4) pgi/10.9            9) python/2.7.3       14) haskell/4.0.0
  5) gstreamer/0.10.32  10) latex/051112

2. update cabal

[yuy121@cyberstar231: ~]# cabal update
Config file path source is default config file.
Config file /gpfs/home/yuy121/.cabal/config not found.
Writing default configuration to /gpfs/home/yuy121/.cabal/config
Downloading the latest package list from hackage.haskell.org
Note: there is a new version of cabal-install available.
To upgrade, run: cabal install cabal-install

Note that all the cabal-related files are stored in ~/.cabal

3. cabal reinstall

[yuy121@cyberstar231: ~]# cabal install cabal-install
Resolving dependencies...
Downloading Cabal-
[ 1 of 65] Compiling Distribution.Compat.Exception ( /tmp/Cabal-, /tmp/Cabal- )
[ 2 of 65] Compiling Distribution.Compat.TempFile ( /tmp/Cabal-, /tmp/Cabal- )


[64 of 65] Compiling Distribution.Client.Install ( Distribution/Client/Install.hs, dist/build/cabal/cabal-tmp/Distribution/Client/Install.o )
[65 of 65] Compiling Main             ( Main.hs, dist/build/cabal/cabal-tmp/Main.o )
Linking dist/build/cabal/cabal ...
Installing executable(s) in /gpfs/home/yuy121/.cabal/bin

4. Install biosff

[yuy121@cyberstar231: ~]# cabal install biosff
Resolving dependencies...
Downloading cmdargs-0.10.3...
Configuring cmdargs-0.10.3...
Building cmdargs-0.10.3...
Preprocessing library cmdargs-0.10.3...
[ 1 of 25] Compiling System.Console.CmdArgs.Implicit.Ann ( System/Console/CmdArgs/Implicit/Ann.hs, dist/build/System/Console/CmdArgs/Implicit/Ann.o )


[8 of 8] Compiling Main             ( src/Flower/Main.hs, dist/build/flower/flower-tmp/Main.o )
Linking dist/build/flower/flower ...
Installing library in /gpfs/home/yuy121/.cabal/lib/biosff-0.3.3/ghc-7.4.2
Installing executable(s) in /gpfs/home/yuy121/.cabal/bin
Registering biosff-0.3.3...

5. Check flower

[yuy121@cyberstar231: ~]# ~/.cabal/bin/flower 
flower: Please provide an input file - or use --help for more information.
Comments Off

# main document
# latex compilier
# bibliography generator
# pdf viewer



UNAME := $(shell uname)

ifeq ($(UNAME), Darwin)

@echo $(OPT) "$(COLOR)===> Viewing PDF… $(NORMAL_COLOR)"
$(PDFVIEW) $(SRC).pdf &

$(SRC).pdf:$(SRC).tex $(SRC).bbl
@echo $(OPT) "$(COLOR)===> Running LaTeX… $(NORMAL_COLOR)"
@echo $(OPT) "$(COLOR)===> Running LaTeX once more… $(NORMAL_COLOR)"

$(SRC).bbl:$(SRC).aux $(SRC).tex
@echo $(OPT) "$(COLOR)===> Running BibTeX… $(NORMAL_COLOR)"

@echo $(OPT) "$(COLOR)===> Running LaTeX for BibTeX… $(NORMAL_COLOR)"

@echo $(OPT) "$(COLOR)===> Tidy up!… $(NORMAL_COLOR)"
rm -f *~
find . -maxdepth 1 -type f -name "$(SRC).*" ! -name "$(SRC).tex" -exec rm -f {} \;
# remove AucTeX-related files.
rm -rf _region_* $(DOC).prv prv_$(DOC).log

Comments Off
C-x C-f /ssh:you@cyberstar.psu.edu:~/scratch/blah
Comments Off

Switch to our mobile site