# Monthly Archives: September 2013

## Change gedit embedded terminal colors

For Ubuntu only:

1. install dconf-tools and gconf-editor
2. in gconf-editor, navigate to apps → gnome-terminal → profiles → Default
3. in dconf-tools, navigate to org → gnome → gedit → plugins → terminal
4. uncheck “use-theme-colors”
5. copy values of “background-color“, “foreground-color“, and “palette“, from gconf-editor to dconf-tools

## Install Gnuplot 4.6 with PDF on Ubuntu

It is always hard to install gnuplot manually on Ubuntu, especially if you want to plot diagram in PDF, JPEG, or PNG formats. This short 101 article describes one way to install gnuplot with PDF on Ubuntu.

1. download pdflib-light and extract to $PDFLIB 2. compile and install pdflib-light cd$PDFLIB
./configure
make
sudo make install

3. refresh lib cache: sudo ldconfig

4. download gunplot and extract to $GNUPLOT 5. compile and install gnuplot cd$GNUPLOT
./configure --with-pdf
make
sudo make install


Note: other packages which can be installed via apt-get

## The best way to place figures side-by-side in Latex

There are different way of placing figures side by side in Latex, subcaption, subfig, subfigure, or even minipage. This post will tell you which one is the best.

## subcaption

A useful extension is the subcaption package (the subfigure and subfig packages are deprecated and shouldn’t be used any more), which uses subfloats within a single float. This gives the author the ability to have subfigures within figures, or subtables within table floats. Subfloats have their own caption, and an optional global caption. An example will best illustrate the usage of this package:

\usepackage{subcaption}
...
\begin{figure}
\begin{subfigure}[b]{0.4\textwidth}
\includegraphics[width=\textwidth]{1.png}
\caption{Picture 1}
\label{fig:1}
\end{subfigure}
%
\begin{subfigure}[b]{0.4\textwidth}
\includegraphics[width=\textwidth]{2.png}
\caption{Picture 2}
\label{fig:2}
\end{subfigure}
\end{figure}


## minipage

The minipage can be used to place figures side-by-side too. But it is not a floating environment, thus has to be placed in a figure environment. Another disadvantage of minipage is that it does not align fi gures. Therefore, subcaption is still the best package you should use.

\begin{figure} \begin{minipage}[b]{0.4\textwidth} \includegraphics[width=\textwidth]{1.png} \caption{Picture 1} \label{fig:1} \end{minipage} \begin{minipage}[b]{0.4\textwidth} includegraphics[width=textwidth]{2.png} \caption{Picture 2} \label{fig:2} \end{minipage} \end{figure}

## 函数式编程的另类指南(4)

The following part is not maintained anymore. Please go to 函数式程序设计的另类指南 for the whole translation.

## How to adjust height of an old Steelcase chair (454311M)?

The chairs do not have the pneumatic mechanism to adjust the height of the chair. The height is adjusted by turning the chair in circles around the base. The base post contains a screw mechanism that gives 2-3″ of adjustment.

## 函数式编程的另类指南(3)

The following part is not maintained anymore. Please go to 函数式程序设计的另类指南 for the whole translation.

## 函数式编程的另类指南(2)

The following part is not maintained anymore. Please go to 函数式程序设计的另类指南 for the whole translation.

## 函数式编程的另类指南(1)

The following part is not maintained anymore. Please go to 函数式程序设计的另类指南 for the whole translation.

## Scale, Standardize, and Normalize Data

Note: Contents and examples in this article are partially from Scikit-learn-Preprocessing data and faqs.org-Should I normalize/standardize/rescale the data

## Scaling

Scaling a vector means to add/substract a constant, then multiply/divide by another constant, so the features can lie between given minimum and maximum values. The motivation to use this scaling include robustness to very small standard deviations of features and preserving zero entries in sparse data. Normally, the given range is [0,1]

$x^*_{i,j}=\frac{x_{i,j}-x^{min}_{j}}{x^{max}_{j}-x^{min}_{j}}$

For example, if we have a dataset like below,