Tuesday, November 29, 2011

LaTeX : pretty printing the difference between two versions

Use latexdiff

e.g. latexdiff ../v01/Complete/main_v02.tex main_v02.tex > diff.tex

Then compile diff.tex (and don't forget to run bibtex, though new citations don't show up as changes)

Monday, November 28, 2011

MS word (Mac os X) Different footer/header text

  1. Insert->Break->Section break(continuous)
  2. Open formatting palette
  3. Uncheck "link to previous"
  4. Enter the new header/footer

Monday, November 21, 2011

WARNING: terminal is not fully functional (After installing Xcode on Mac OS X)

From the first answer here:
  1. This is due to xcode install messing with /usr/share/terminfo
  2. The default terminal is xterm-256color which is removed from /usr/share/terminfo/78
  3. If you have a TimeMachine backup, use that to restore /usr/share/terminfo. 
  4. If you don't, use the file provided here.

Sunday, November 20, 2011

How to get file creation time on Mac OS X (64 bit)

  • QFileInfo.created() on POSIX systems (like Mac OS X) returns the last modified time.
  • This is annoying because on Mac OS X you know the system (e.g. finder) has access to the actual creation time.
  • Turns out that BSD systems (like Mac OS X) have an extension to sys/stat.h that contains the file creation time.
The recipe, then is (shown using the QT framework):
#include <QtCore>
#include <sys/stat.h>

int main(int argc, char *argv[])
    QString fname("/Users/kghose/Sandbox/ChhobiTest/2005/2005_07_10/MVI_0693.AVI");
    QDateTime thedatetime;
    struct stat64 the_time;
    stat64(fname.toStdString().c_str(), &the_time);
    qDebug() << thedatetime;

Monday, November 7, 2011

MenuMeters (Replacement for iStat)

MenuMeters is an opensource program that does, very colorfully, what iStat does and works on Lion. The appearance is not as slick as iStat, but it is very configurable.