Monthly Archives: August 2010

My Ubuntu configuration

Software from the Ubuntu repository libboost1.40-dev & libboost-program-options dkms (if running as a guest using VirtualBox) emacs23 (and use ClearLook as the appearance choice) gcc (a pre-requisite for boost) & g++ git: gitk GNU Scientific Library: libgsl0-dev saidar subversion latex: texlive-doc-en, … Continue reading

Posted in linux/unix | Leave a comment

My VirtualBox configuration

Goals: Run the guest in full-screen mode. This requires that the guest run VitualBox’s Guest Additions. Access my Dropbox but without creating a separate copy of it in the guest. The host already has a copy and my Dropbox is … Continue reading

Posted in linux/unix, OS X, VirtualBox | Tagged | Leave a comment

Comparing directories using diff

diff -rq DIR_A DIR_B -r: recursive -q: output only when files differ Source: The source also describes how to pipe the output of diff to clean it up.

Posted in linux/unix | Leave a comment

Roland White, Vulcan 607

The book tells the amazing and true story of the British air strike on the Falklands. It has load of technical details and the story is well told.

Posted in Book review | Leave a comment

boost unordered map/set

key is a built-in type typedef boost::unordered_map<std::string,int> Map; Map map; typedef boost::unordered_set<std::string,int> Set; Set set; key is a program-defined type T struct T { T2 key1; T3 key2: friend bool operator<(const T2& a,const T3& b) { return (a.key1<b.key1) || (a.key1==b.key1 … Continue reading

Posted in Uncategorized | Leave a comment

Function object skeleton

class F { S s_; // private state public: F (const S& s) : s_(s) {}; // constructor T operator() (..) {…}; // mutate s_ and return a T instance const S& state() const {return s_; } // recover state … Continue reading

Posted in C++ | Leave a comment

C++ file I/O

To write to a ofstream (output file stream) // common error: not closing the ofstream #include <fstream> #include <string> … std::string name; std::ofstream output_file(name.c_str()); if (!output_file) error(“can’t open”); …  // read the records output_file.close(); To read from an ifstream #include … Continue reading

Posted in C++ | Leave a comment

Which C++ header?

Name Include cout iostream ifstream fstream istringstream sstream ofstream fstream

Posted in C++ | Leave a comment

Emacs Cheat Sheet

Cutting and pasting C-spc  Mark one end of region C-w     Cut (w=whiteout) M-w    Copy(whiteout then repaste) C-y      Yank most recently cut or copied

Posted in C++ | Leave a comment

Hello world!

Welcome to This is your first post. Edit or delete it and start blogging!

Posted in Uncategorized | 1 Comment