Sunday, May 17, 2009

Making a C++ object printable to standard output

You want to make a C++ object printable to the standard output. For example you have an object call ScoredSequence and you want do be able to do: ScoredSequence s("BLAHBLAH"); cout << s; You need to add a << operator to ScoredSequence, for example:

class ScoredSequence {

ScoredSequence(string s) : sequence(s) {

string get_sequence() {
return s;

/// \brief Extractor which prints the whole sequence.
inline friend std::ostream& operator<<(std::ostream& out, const ScoredSequence& s) {
out << s.get_sequence();
return out;

string sequence;

Tuesday, May 12, 2009

delete all linefeeds from a file

like this:

tr -d "\n" < gaps2 > nogaps

Thursday, May 7, 2009

Connect to Freerunner Android from Opensuse

Plug in the freerunner, and yast2 should prompt you to configure a new network device of type usb. Follow the instructions, and configure using ifup (Not network manager) and use a static IP address for the freerunner. Assign it to

The adb program is available here:

Download it and put it somewhere and make it executable.

Then save this set of commands as a bash script with a name like connect or whatever.


$/usr/local/share/adb kill-server
$ADBHOST= /usr/local/share/adb devices
$/usr/local/share/adb shell

Make this executable and then run it. It should drop you automatically into the shell interface on your freerunner.