Programming

Table of Contents

Python

$ conda install -c conda-forge tmux

  • Post-Installation

$ conda config --set auto_activate_base false
# It creates ~/.condarc with following content:
auto_activate_base: false

  • Jupyter notebook

$ conda install ipykernel
$ python -m ipykernel install --user --name lal --display-name "python-lal"
# It modifies ~/Library/Jupyter/kernels/ or ~/.local/share/jupyter/kernels/

$ pip -V
$ python -m site

HTTP server

  • Start a http server

$ python3 -m http.server

Virtual Environment

  • virtualenv

$ virtualenv <myenv>
$ source myenv/bin/activate
$ deactivate

  • pip

$ pip freeze > requirements.txt
$ pip install -r requirements.txt

C/C++


Haskell

$ sudo port install ghc


Latex

Setup

$ sudo apt-get install texlive-full

Packages

\usepackage{amsmath} % AMS math
\usepackage{amssymb} % AMS symbols
\usepackage{physics} % \bra \ket ...

% Text Color
\usepackage{xcolor}
\newcommand{\red}{\textcolor{red}}
\newcommand{\blue}{\textcolor{darkblue}}

% Hyperlink
\usepackage[colorlinks]{hyperref}
\definecolor{darkblue}{HTML}{2E3092}
\hypersetup{colorlinks=true,linkcolor=darkblue,citecolor=darkblue,urlcolor=darkblue}

\usepackage{amsthm} % AMS theorem
\theoremstyle{definition}
\newtheorem{example}{Example}[section]
\newtheorem*{solution*}{Solution}

Packages

\usepackage[sc]{mathpazo}
\linespread{1.05} % Palladio needs more leading (space between lines)
\usepackage[T1]{fontenc}

Makefile

  • $ latexmk -pdf main.tex

Git

Gitignore

# .gitignore

**/.DS_Store