Wednesday, June 10, 2009
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 {
public:
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;
}
private:
string sequence;
};
Tuesday, May 12, 2009
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 192.168.0.200.
The adb program is available here: http://people.openmoko.org/sean_mcneil/adb
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.
Make this executable and then run it. It should drop you automatically into the shell interface on your freerunner.
The adb program is available here: http://people.openmoko.org/sean_mcneil/adb
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.
#!/bin/bash
$/usr/local/share/adb kill-server
$ADBHOST=192.168.0.202 /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.
Thursday, April 30, 2009
Multi column table in latex
You want a table the spans across pages and raps in 2 columns. You need supertabular and to stick everything in a \twocolumn. Do it:
\pagebreak
\twocolumn
\begin{supertabular}{ |l|c|l| }
\hline
stuff1 & stuff2 & stuff3 \\
1 & 2 & 3 \\
1 & 2 & 3 \\
1 & 2 & 3 \\
1 & 2 & 3 \\
1 & 2 & 3 \\
1 & 2 & 3 \\
1 & 2 & 3 \\
1 & 2 & 3 \\
1 & 2 & 3 \\
1 & 2 & 3 \\
1 & 2 & 3 \\
1 & 2 & 3 \\
\hline
\end{supertabular}
\onecolumn
\pagebreak
Friday, April 17, 2009
latex "File ignored" not found on nfs ( isilon )
You are unable to compile latex files (i.e. latex myreport.tex) on an nfs drive but they compile correctly from the local disk. You receive errors such as "File ignored" or "no found". In my case this occurred when using an Isilon. The solution is to switch file ID size from 64bit to 32bit on the isilon configuration. "File Sharing"->NFS->"Edit Settings" on the Isilon web configuration.
Friday, April 3, 2009
Growing a VM
I started a VM with the default 8Gb for a linux install. I have successfully added additional HDD to the VM but eventually I hit a problem that required editing the actual size of the main disk. I used the vmware-vdiskmanager (-x 12Gb Kubuntu.vmdk) to successfully resize the VM disk. Then I booted the VM into a gparted image using the ISO as a CD (option in the VMware server). This worked fine. I then edited the partition. First increase the size of the swap. Then shift it to the right and then make it smaller again, before resizing the main partition. Click apply changes and then wait. Or in my case head up to the terrace and enjoy beer and "Schnittchen". The KDE session does appear borked after all this. It complains about some DCOP setting not running. I tried changing permissions on the tmp dir and following general advice on the internet - however moving .kde to .kde_old solved the problem for me. The partition is now showing up as 12 gigs and all the files seem to be okay.
Subscribe to:
Posts (Atom)