Google
 

2/28/07

Switch between gdm and kdm.

Open a terminal window and type in the following command:

dpkg-reconfigure gdm

/etc/hosts.allow and hosts.deny

when I did nvidia update, the screen always has problem, showing inbound etc. What I did is to stop guarddog.
In the Guarddog, there is a tab "loging", where you can change how often the inbound or outbound is written to the system log file.

Stop Xserver to install Nvidia driver.

If you are using NVdia card, you will have this problem. When you need to update the driver, you need to stop the Xserver before you do it. Here is how you can do it.
1.

/etc/init.d/[gkx]dm stop


whether you use gdm stop or kdm stop or xdm stop depends on what you are using. You need to be root in order to do this.

2. Now you can update your Nvidia driver. Usually you do it like the following:

nvidia-installer --update

Mac fink installation.

On Mac I installed fink. It is very good. I installed xfig, and latex using fink. However I spent quite a while try to find where those exec files are. It turned out that most of the files are in the folder: /sw/bin/

2/27/07

On Mac use Keynote to prepare big posters.

Setup the page size correctly:

First generate an empty page, then go to the inspector. Select the first tab, then click the slide size drop-down and pick “Custom Slide Size”. Keynote assumes 72 pixels per inch, so multiply your desired poster size by 72 and enter that for the slide size height and width. Personally for my poster (44 inch x 36 inch), the numbers are: (3168x2592).

Note that Keynote will insert a white margin around your poster when you go to print it, so you don’t need to put a border around things when designing your poster. You can put objects right up to the very edge of the slide and they will still print OK.

2/24/07

suse yast source

http://en.opensuse.org/YaST_Software_Management

2/16/07

Using C++ to read a tab seperated Matlab matrix

#include <iostream>
#include <istream>
#include <fstream>
#include <sstream>
#include <vector>
#include <string>
#include <iterator>
#include <algorithm> // for copy

using namespace std;

// template <class T>
// std::vector<T> StringToVec( const std::string& Str );
// Tokenize a passed line/string into a vector
// e.g:
// std::string str = "1 2 3 4";
// std::vector<int> vec = StringToVector<int>(str);

template <class T>
vector<T> StringToVec( const string &str )
{
vector<T> MyVec;
istringstream iss (str, istringstream::in);
copy(istream_iterator<T>(iss), istream_iterator<T>(), back_inserter(MyVec)); //check http://www.sgi.com/tech/stl/istream_iterator.html
return MyVec;
}

The following use the above template to read in a big matrix from a file. Using C++ to read big matrix from a file, need the above code.


int main()
{
vector< vector<float> > Matrix;
vector<float> Row;
string Line;
ifstream in("./test.dat");
if( !in ) {
cerr << "can't open file" << endl;
return false;
}

// read matrix row's
while( getline( in, Line) ) {
Row = StringToVec<float>( Line );
Matrix.push_back( Row );
Row.clear();
}

// output the matrix
for( vector< vector<float> >::iterator IterRow = Matrix.begin(); IterRow !=
Matrix.end(); ++IterRow ) {
for( vector<float>::iterator IterCol = IterRow->begin(); IterCol !=
IterRow->end(); ++IterCol ) {
cout << *IterCol << " ";
}
cout << endl;
}

return 1;

}

2/13/07

Matlab no GUI.

he first "Solution" practically worked for me with:

export LD_ASSUME_KERNEL=2.4.1

to the effect that the matlab window now pops up and remains, though the fonts seem to be a little too big...

2/8/07

install gfortran from source file.

On Wed, Sep 21, 2005 at 06:09:52PM -0400, Prof J C Nash wrote:
> In trying to install gfortran I note that the installation instructions
> link leads to a blank page. Is there a good link please? (Linux install,
> specifically Debian for Xandros 3.02.
>

John,

To build gfortran from the gcc source distribution on linux
should be fairly straigth forward.

(1) Get gcc-4.0.1.tar.gz (see gcc.gnu.org)
Note 4.0.2 will be released in the next few days, and you'll
definitely want 4.0.2 over 4.0.1.
(2) Unpack.
cd tmp
tar xzf /path/to/gcc-4.0.1.tar.gz
(3) To build gfortran
mkdir obj
cd obj
../gcc-4.0.1/configure --enable-languages='c,fortran'
make bootstrap
(4) Install gfortran
make install
(5) Try buildling your software. Send bug reports.

Note, this will put gfortran under /usr/local/ if you want a
different directory use --prefix=/path/to/gfortran with configure.

--enable-languages=lang1,lang2,...
Specify that only a particular subset of compilers and their runtime libraries should be built. For a list of valid values for langN you can issue the following command in the gcc directory of your GCC source tree:
grep language= */config-lang.in

Currently, you can use any of the following: all, ada, c, c++, fortran, java, objc, obj-c++, treelang. Building the Ada compiler has special requirements, see below. If you do not pass this flag, or specify the option all, then all default languages available in the gcc sub-tree will be configured. Ada, Objective-C++, and treelang are not default languages; the rest are. Re-defining LANGUAGES when calling `make bootstrap' does not work anymore, as those language sub-directories might not have been configured!



Here are binary files for Mac.

http://gcc.gnu.org/wiki/GFortranBinaries

2/7/07

Backup data under linux.

We just got the 500G external hard drive. The task is to backup the data in the linux system, mainly the research data.
First tried the following scripts:

#!/bin/bash
CurDate=`date +"%m%d%y"`
tar --verify -cf /media/usbdisk2/username/linuxbk/home_$CurDate.monthlyfull.tar /home/username/

However, there was an error, saying that "8811 File size limit exceeded". Then I searched the website and find the following solution by using split.

#!/bin/bash
CurDate=`date +"%m%d%y"`
tar cPf - /home/username/|(cd /media/usbdisk2/username/linuxbk/; split --verbose --bytes=1000m - home_$CurDate.monthlyfull.tar)

Here I split the cells by 1 G. This does work and there is no error on this. Now the question is how to recover this if necessary.

cat /media/usbdisk2/username/linuxbk/home_$CurDate.monthlyfull.tar* | tar xvf - {/home/{{dirs}/files}}

"You can cat from anywhere since you used the "P" tar option which preserves the root "? Here maybe it is better not to use "P" option, because that may overwrite the username home directory when restore it.