- I agree the Necessity of Diversity in University.
- I prefer the C language. Yeah, I am C言人 or C原人.
- "Too simple is the worst". What do you think about this?
- C: Comparison of compling options with gcc and icc on linux. Not completed.
- sed: Delimitar is arbitrary. The character after "s" is used as the delimitar. This is used to avoid the error message "unknown option to `s'". Also, one does not have to 'escape' the slash, which is the default(?) delimitar.
- Aspell: How to recognise a new command that should be ignored by Aspell. Add the following line to ~/.aspell.conf or /etc/aspell.conf:
add-tex-command xxx op # for example, xxx="autoref"
- Latex 'numprint' package: Unexpected behaviour of numprint command. This issue was resolved quickly thanks to some texnitians.
- screen: To show the status on the bottom of the window, add the following lines:
hardstatus alwayslastline "%{.bW}%-w%{.rW}%n %t%{-}%+w %=%{..G} %H %{..Y} %Y %m/%d %C%a "
hardstatus off
- Emacs auto-complete: First of all, you may install auto-install.el according to this page. And then, this page tells us how to install auto-complete.el.
- turbostat: How to know if Turbo Boost is working?
wget http://mirror.linux.org.au/linux/kernel/people/lenb/acpi/utils/pmtools-latest/turbostat/turbostat.c
wget http://mirror.linux.org.au/linux/kernel/people/lenb/acpi/utils/pmtools-latest/turbostat/Makefile
make
./turbostat -v # Root priviledge is necessary
- Acrobat Reader: How to show the menu bar? Press "Ctrl+h".
- Emacs: with Anthy sudo apt-get install anthy-el
- Linux: Burn CD/DVD growisofs -dvd-compat -speed=12 -Z /dev/dvdrw=XXX.iso
- FFmpeg: A complete, cross-platform solution to record, convert and stream audio and video. For example,
$ ffmpeg -i input.mp4 output.avi
- Valgrind: How to profile memory usage using valgrind?
$ valgrind --tool=massif ./a.out
$ ms_print massif.out.pid | less
Awesome!
- Linux: How to check Intel Turbo boost?
- TeX: Easies?t way to delete a column?
%\usepackage{array} % necessary?
\newcolumntype{H}{>{\setbox0=\hbox\bgroup}c<{\egroup}@{}}
\begin{tabular}{cHcc}
t & e & x & t % e does not appear
\end{tabular}
Or
\newcolumntype{H}{>{\iffalse}c<{\fi}@{}}
works too.
- iso to DVD: growisofs -dvd-compat -speed=8 -Z /dev/dvd=hoge.iso, where /dev/dvd is a DVD device and hoge.iso is an image file to be written.
- TeX: ! No room for a new \count. Use "\usepackage{etex}". This error occured when I was trying to use numprint package. etex worked for this case.
- TeX+Tikz: latex -> dvips -> ps2pdf rather than pdflatex. Not platex, but latex. I'm not sure this works for any syle file though.
- gcc: Print information whether an optimization is successfully applied or not. Use -fopt-info-vec-{optimized,missed,note} or -fopt-info-vec-all. This option is valid for recent versions including 4.9.
- LAPACK: It looks necessary to use the recursive option, i.e., -frecursive for gfortran and -recursive for ifort, to build the LAPACK as well as BLAS. Note that -fopenmp automatically sets -frecursive option. I am not sure, but the caller functions must be compiled with such a recursive option.
- Intel MKL: Intel MKL linke line advisor This may be useful. I need more information for liking though.
- Linux: "tail -f" says "no space on device" Add "fs.inotify.max_user_watches = 32768" to /etc/sysctl.conf and then "sysctl -p /etc/sysctl.conf"
- make: Shell commands in makefile For example, one can substitute the result of 'ls' command into a vaiable 'LS' by "LS=$(shell ls)" and then use the variable like "echo ${LS}". Note that if "LS=$(ls)$" is used, the 'ls' command is evaluated when ${LS} is expanded. (I am not sure, but the result looks so.)
- Acrobat reader: How to show the missing "Menu bar"? Press F8 key.
- TeX: Beamer with Japanese
\documentclass[dvipdfm]{beamer}
platex foo
dvipdfmx foo.dvi
- Linux: Rename files Format: rename from to file(s). Example: rename foo FOO foo*.txt
- C/C++: How to list compiler predefined macros For example, {icc|gcc} -dM -E -x c /dev/null
- g++: Square root of complex numbers and this
- Duplicity: duplicity /usr scp://host.net/target_dir
- C: -mfp-trap-mode=n (gcc), -fp-trap=all (icc)
- C: glibc online manual
- C: Useful macros provided by math.h: __isinf(x), __isnan(x), or fpclassify(x)
- C: clog(z1 * z2) != clog(z1) + clog(z2)
- Gnuplot: "Wheel" = down/up; "Shift+wheel" = left/right
- firefox: howto install Firefox 24 on Fedora 19/18/17/16/15/14, CentOS 6.4/6.3/6.2/6.1/6 and Red Hat (RHEL) 6.4/6.3/6.2/6.1/6 using YUM: Thanks god!
- TeX: A period after an abbreviation is the same as an end of sentence period?: It seems that the resolution is ... hmmm... See how to implement "etc." correctly, that is,
\makeatletter
\newcommand\etc{etc\@ifnextchar.{}{.\@}}
\makeatother
- Evince: How to open the same pdf in multiple windows?: "File -> Open a copy" or "Ctrl+n"
- TeX: printing floating-point numbers and rounding numbers:
cd /usr/share/texmf/tex/generic
unzip (path)/numprint.zip
mktexlsr
Here is an example:
\documentclass{article}
\usepackage{numprint}
% If you want to use English notations (See Section 6)
%\documentclass[english]{article}
%\usepackage[autolanguage]{numprint}
\begin{document}
\npthousandsep{} % See Section 8.1.1 (instead of autolanguage option)
\npdecimalsign{.}
\npproductsign{\times}
$\numprint{+-3.1415927e-3.1}$ % looks like $\pm 3.1415927 \times 10^{-3.1}$
\nprounddigits{2} % Enables to round numbers hereafter
$\numprint{1.123}$ % 1.12
$\numprint{1.149}$ % 1.15
$\numprint{1}$ % 1.00
\npnoround % Disables to round numbers hereafter
\npaddplus % Enables to add the plus sign hereafter
$\numprint{1.123}$ % +1.123
$\numprint{-1.123}$ % -1.123
\npnoaddplus % Disables to add the plus sign hereafter
$\numprint{1.123}$ % +1.123
\end{document}
- TeX: How to "do nothing"? I have been annoyed by my macro \def\DEL#1{} because it can put a slight space. However, I have realised that \def\DEL#1{\hspace 0pt} works better! I think there is an intrinsic command to do nothing though.
- pgfplots: How to install pgfplots properly?
rm -rf /usr/share/texmf/tex/generic/pgfplots
rm -rf /usr/share/texmf/tex/latex/pgfplots
rm -rf /usr/share/texmf/tex/plain/pgfplots
rm -rf /usr/share/texmf/tex/context/third/pgfplots
cd /usr/share/texmf
unzip pgf_1.8.tds.zip
mktexlsr
- bash&awk: Round real numbers
function sg()
{
local num=$1
local val=$(echo ${num} | awk '{printf("%d\n", $1*10+0.5)}' | awk '{printf("%f\n", $1/10)}')
echo ${val}
}
sg 1.12
sg 1.13
sg 1.14
sg 1.15
sg 1.16
sg 1.17
Then, you will obtain
1.1
1.1
1.1
1.2
1.2
1.2
- pgf: How to install pgf (tikz) properly?
rm -rf /usr/share/texmf/tex/generic/pgf
rm -rf /usr/share/texmf/tex/latex/pgf
rm -rf /usr/share/texmf/tex/plain/pgf
rm -rf /usr/share/texmf/tex/context/third/pgf
cd /usr/share/texmf
unzip pgf_2.10.tds.zip
mktexlsr
If you don't remove the above files, you will see the following error message:
! Undefined control sequence.
l.875 \pgfsetsnakesegmenttransformation
{\pgf@snake@mirror\pgf@snake@raise}
- Dropbox: Dropbox's command-line interface; dropbox {status|start|stop|help|etc..}
- Dropbox: If you cannot syncronise with the server at all, select "Preferences" in the menu, open "Account", and press "Unlink This Computer". Then, you can update all the files.
- Bash: How to implement a rotaing bar? Here is my first solution: