Archive for June, 2006

How load average is calculated?

Friday, June 30th, 2006

Have you ever wondered how load average on Unix is defined?

Web-based diagram drawing

Thursday, June 29th, 2006

Multi-line matches with regular expressions (pcregrep)

Monday, June 26th, 2006

Proofreading my thesis I had the following problem: Find all occurrences of “alert processing system” (should be “alert-processing system”), which can span over multiple lines.

I found out (thanks Diego!) a number of ways of doing this.

  1. Writing my own perl program and defining INPUT_RECORD_SEPARATOR ($/)

  2. Using agrep, in which I can use -d ‘delim’ as the separator. The advantage of agrep is that is can also find mispelled words (with a certain editing distance).

  3. Using pcregrep!

I chose the last solution as it is the simplest one:

pcregrep -Mi 'alert\s+processing\s+system' <file>

IT WORKS!

43folders and lifehacker

Friday, June 23rd, 2006

Two cool blogs about life hacking, productivity, cook gadgets and the like – a must have for a geek like me: http://www.43folders.com, http://www.lifehacker.com

17 Mistakes Microsoft Made in the Xbox Security System – Xbox-Linux

Wednesday, June 21st, 2006

A cool article on mistakes made in Xbox. Talks a lot about building (in)secure hardware/software systems (may be useful when looking at the TPM stuff).

Captions in Latex tables

Wednesday, June 7th, 2006

Writing my thesis, I had to create a table with table captions located below the table. Without much thinking I looked at the Latex bible and read about three ways of doing it.

The solution I chose was to use a package `threeparttable’, which did exactly what I wanted. Here’s my code:

\usepackage{threeparttable}

\begin{table}[htb]
  \centering
  \begin{threeparttable}
    \caption{Caption.}
    \begin{tabulary}{\linewidth}{|L|C|}
      \hline a\tnote{a} & b\tnote{b} \\
      \hline
    \end{tabulary}
    \begin{tablenotes}[para]
      \scriptsize
      \item[a] Footnote a.
      \item[b] Footnote b.
    \end{tablenotes}
    \label{table:ml_requirements}
  \end{threeparttable}
\end{table}